/*
 * 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 PREDEFINED_TYPES implements XdrAble, java.io.Serializable {
    /** TODO */
    protected PredefinedTypeA a;
    /** TODO */
    protected PredefinedTypeB[] b;
    /** TODO */
    protected PredefinedTypeC[] c;

    private static final long serialVersionUID = 6141695497722778223L;

    public void setA(PredefinedTypeA a) {
        this.a = a;
    }
    public PredefinedTypeA getA() {
        return this.a;
    }

    public void setB(PredefinedTypeB[] b) {
        this.b = b;
    }
    public void setB(int index, PredefinedTypeB bElement) {
        this.b[index] = bElement;
    }
    public PredefinedTypeB[] getB() {
        return this.b;
    }
    public PredefinedTypeB getB(int index) {
        return this.b[index];
    }

    public void setC(PredefinedTypeC[] c) {
        this.c = c;
    }
    public void setC(int index, PredefinedTypeC cElement) {
        this.c[index] = cElement;
    }
    public PredefinedTypeC[] getC() {
        return this.c;
    }
    public PredefinedTypeC getC(int index) {
        return this.c[index];
    }

    public PREDEFINED_TYPES() {
    }

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

    public PREDEFINED_TYPES(PredefinedTypeA a, PredefinedTypeB[] b,
           PredefinedTypeC[] c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public void xdrEncode(XdrEncodingStream xdr)
           throws OncRpcException, IOException {
        a.xdrEncode(xdr);
        demoCodingSupplement.xdrEncodeFixedVector_PredefinedTypeB(xdr, b, 2);
        demoCodingSupplement.xdrEncodeDynamicVector_PredefinedTypeC(xdr, c);
    }

    @Override
    public void xdrDecode(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        a = demoCodingSupplement.xdrDecode_PredefinedTypeA(xdr);
        b = demoCodingSupplement.xdrDecodeFixedVector_PredefinedTypeB(xdr, 2);
        c = demoCodingSupplement.xdrDecodeDynamicVector_PredefinedTypeC(xdr);
    }

    @Override
    public String toString() {
        return "PREDEFINED_TYPES ["
        + "a=" + a + ", "
        + "b=" + java.util.Arrays.toString(b) + ", "
        + "c=" + java.util.Arrays.toString(c)
        + "]";
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        PREDEFINED_TYPES other = (PREDEFINED_TYPES)obj;
        if (! java.util.Objects.equals(this.a, other.a)) return false;
        if (! java.util.Arrays.equals(this.b, other.b)) return false;
        if (! java.util.Arrays.equals(this.c, other.c)) return false;
        return true;
    }

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

}
// End of PREDEFINED_TYPES.java
