/*
 * Copyright 2018 Scytl Secure Electronic Voting SA
 *
 * All rights reserved
 *
 * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
 */
package com.scytl.products.ov.mixnet.commons.beans.proofs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.scytl.cryptolib.mathematical.groups.impl.Exponent;

/**
 * Encapsulates the answer generated by a {@link ZeroProofGenerator}.
 */
public class ZeroProofAnswer {

    private final Exponent[] a;

    private final Exponent[] b;

    private final Exponent r;

    private final Exponent s;

    private final Exponent t;

    @JsonCreator
    public ZeroProofAnswer(@JsonProperty("exponentsA") final Exponent[] a,
            @JsonProperty("exponentsB") final Exponent[] b, @JsonProperty("exponentR") final Exponent r,
            @JsonProperty("exponentS") final Exponent s, @JsonProperty("exponentT") final Exponent t) {
        this.a = a;
        this.b = b;
        this.r = r;
        this.s = s;
        this.t = t;
    }

    /**
     * @return Returns the a.
     */
    public Exponent[] getExponentsA() {
        return a;
    }

    /**
     * @return Returns the b.
     */
    public Exponent[] getExponentsB() {
        return b;
    }

    /**
     * @return Returns the r.
     */
    public Exponent getExponentR() {
        return r;
    }

    /**
     * @return Returns the s.
     */
    public Exponent getExponentS() {
        return s;
    }

    /**
     * @return Returns the t.
     */
    public Exponent getExponentT() {
        return t;
    }

    @Override
    public String toString() {
        final StringBuilder strbldr = new StringBuilder();
        for (Exponent a_a : a) {
            strbldr.append(a_a.toString());
        }
        for (Exponent a_b : b) {
            strbldr.append(a_b.toString());
        }
        strbldr.append(r.toString());
        strbldr.append(s.toString());
        strbldr.append(t.toString());
        return strbldr.toString();
    }
}
