/*
 * 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.ov.mixing.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 SingleValueProductProofGenerator}.
 */
public final class SingleValueProductProofAnswer {

    private final Exponent[] tildeA;

    private final Exponent[] tildeB;

    private final Exponent tildeR;

    private final Exponent tildeS;

    @JsonCreator
    public SingleValueProductProofAnswer(@JsonProperty("exponentsTildeA") final Exponent[] tildeA,
            @JsonProperty("exponentsTildeB") final Exponent[] tildeB,
            @JsonProperty("exponentTildeR") final Exponent tildeR,
            @JsonProperty("exponentTildeS") final Exponent tildeS) {
        this.tildeA = tildeA;
        this.tildeB = tildeB;
        this.tildeR = tildeR;
        this.tildeS = tildeS;
    }

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

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

    /**
     * @return Returns the tildeR.
     */
    public Exponent getExponentTildeR() {
        return tildeR;
    }

    /**
     * @return Returns the tildeS.
     */
    public Exponent getExponentTildeS() {
        return tildeS;
    }

    @Override
    public String toString() {
        final StringBuilder strbldr = new StringBuilder();
        for (final Exponent a_tildeA : tildeA) {
            strbldr.append(a_tildeA.toString());
        }
        for (final Exponent a_tildeB : tildeB) {
            strbldr.append(a_tildeB.toString());
        }
        strbldr.append(tildeR.toString());
        strbldr.append(tildeS.toString());
        return strbldr.toString();
    }

}
