/*
 * Automatically generated by jrpcgen 1.1.6 on 21.02.24 22:11
 * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
 * See http://remotetea.sourceforge.net for details
 */
package tests.org.acplt.oncrpc.jrpcgen;
import org.acplt.oncrpc.*;
import java.io.IOException;

/** TODO */
public class SOMERESULT implements XdrAble, java.io.Serializable {
    /** TODO */
    protected int error;
    /** TODO */
    protected String typedesc;
    /** TODO */
    protected byte[] data;
    /** TODO */
    protected SILLYSTRUCT[] arrayone;
    /** TODO */
    protected SILLYSTRUCT[] arraytwo;
    /** TODO */
    protected STRING stringone;
    /** TODO */
    protected STRINGVECTOR stringarray;

    private static final long serialVersionUID = 405847898459777214L;

    public void setError(int error) {
        this.error = error;
    }
    public int getError() {
        return this.error;
    }

    public void setTypedesc(String typedesc) {
        this.typedesc = typedesc;
    }
    public String getTypedesc() {
        return this.typedesc;
    }

    public void setData(byte[] data) {
        this.data = data;
    }
    public void setData(int index, byte dataElement) {
        this.data[index] = dataElement;
    }
    public byte[] getData() {
        return this.data;
    }
    public byte getData(int index) {
        return this.data[index];
    }

    public void setArrayone(SILLYSTRUCT[] arrayone) {
        this.arrayone = arrayone;
    }
    public void setArrayone(int index, SILLYSTRUCT arrayoneElement) {
        this.arrayone[index] = arrayoneElement;
    }
    public SILLYSTRUCT[] getArrayone() {
        return this.arrayone;
    }
    public SILLYSTRUCT getArrayone(int index) {
        return this.arrayone[index];
    }

    public void setArraytwo(SILLYSTRUCT[] arraytwo) {
        this.arraytwo = arraytwo;
    }
    public void setArraytwo(int index, SILLYSTRUCT arraytwoElement) {
        this.arraytwo[index] = arraytwoElement;
    }
    public SILLYSTRUCT[] getArraytwo() {
        return this.arraytwo;
    }
    public SILLYSTRUCT getArraytwo(int index) {
        return this.arraytwo[index];
    }

    public void setStringone(STRING stringone) {
        this.stringone = stringone;
    }
    public STRING getStringone() {
        return this.stringone;
    }

    public void setStringarray(STRINGVECTOR stringarray) {
        this.stringarray = stringarray;
    }
    public STRINGVECTOR getStringarray() {
        return this.stringarray;
    }

    public SOMERESULT() {
    }

    public SOMERESULT(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        xdrDecode(xdr);
    }

    public SOMERESULT(int error, String typedesc, byte[] data,
           SILLYSTRUCT[] arrayone, SILLYSTRUCT[] arraytwo, STRING stringone,
           STRINGVECTOR stringarray) {
        this.error = error;
        this.typedesc = typedesc;
        this.data = data;
        this.arrayone = arrayone;
        this.arraytwo = arraytwo;
        this.stringone = stringone;
        this.stringarray = stringarray;
    }

    @Override
    public void xdrEncode(XdrEncodingStream xdr)
           throws OncRpcException, IOException {
        xdr.xdrEncodeInt(error);
        xdr.xdrEncodeString(typedesc);
        xdr.xdrEncodeDynamicOpaque(data);
        SILLYSTRUCT.xdrEncodeDynamicVector(xdr, arrayone);
        SILLYSTRUCT.xdrEncodeFixedVector(xdr, arraytwo, 24);
        stringone.xdrEncode(xdr);
        stringarray.xdrEncode(xdr);
    }

    @Override
    public void xdrDecode(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        error = xdr.xdrDecodeInt();
        typedesc = xdr.xdrDecodeString();
        data = xdr.xdrDecodeDynamicOpaque();
        arrayone = SILLYSTRUCT.xdrDecodeDynamicVector(xdr);
        arraytwo = SILLYSTRUCT.xdrDecodeFixedVector(xdr, 24);
        stringone = new STRING(xdr);
        stringarray = new STRINGVECTOR(xdr);
    }

    @Override
    public String toString() {
        return "SOMERESULT ["
        + "error=" + error + ", "
        + "typedesc=" + typedesc + ", "
        + "data=" + java.util.Arrays.toString(data) + ", "
        + "arrayone=" + java.util.Arrays.toString(arrayone) + ", "
        + "arraytwo=" + java.util.Arrays.toString(arraytwo) + ", "
        + "stringone=" + stringone + ", "
        + "stringarray=" + stringarray
        + "]";
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        SOMERESULT other = (SOMERESULT)obj;
        if (this.error != other.error) return false;
        if (! java.util.Objects.equals(this.typedesc, other.typedesc)) return false;
        if (! java.util.Arrays.equals(this.data, other.data)) return false;
        if (! java.util.Arrays.equals(this.arrayone, other.arrayone)) return false;
        if (! java.util.Arrays.equals(this.arraytwo, other.arraytwo)) return false;
        if (! java.util.Objects.equals(this.stringone, other.stringone)) return false;
        if (! java.util.Objects.equals(this.stringarray, other.stringarray)) return false;
        return true;
    }

    @Override
    public int hashCode() {
        return XdrHashCode.hashCode(this);
    }

}
// End of SOMERESULT.java
