All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Energistics.Protocol.Core.OpenSession Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package Energistics.Protocol.Core;

import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.SchemaStore;
import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class OpenSession extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
    private static final long serialVersionUID = -3007908091687717683L;
    public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"OpenSession\",\"namespace\":\"Energistics.Protocol.Core\",\"fields\":[{\"name\":\"applicationName\",\"type\":\"string\"},{\"name\":\"applicationVersion\",\"type\":\"string\"},{\"name\":\"sessionId\",\"type\":\"string\"},{\"name\":\"supportedProtocols\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"SupportedProtocol\",\"namespace\":\"Energistics.Datatypes\",\"fields\":[{\"name\":\"protocol\",\"type\":\"int\"},{\"name\":\"protocolVersion\",\"type\":{\"type\":\"record\",\"name\":\"Version\",\"fields\":[{\"name\":\"major\",\"type\":\"int\"},{\"name\":\"minor\",\"type\":\"int\"},{\"name\":\"revision\",\"type\":\"int\"},{\"name\":\"patch\",\"type\":\"int\"}],\"fullName\":\"Energistics.Datatypes.Version\",\"depends\":[]}},{\"name\":\"role\",\"type\":\"string\"},{\"name\":\"protocolCapabilities\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"DataValue\",\"fields\":[{\"name\":\"item\",\"type\":[\"null\",\"double\",\"float\",\"int\",\"long\",\"string\",{\"type\":\"record\",\"name\":\"ArrayOfDouble\",\"fields\":[{\"name\":\"values\",\"type\":{\"type\":\"array\",\"items\":\"double\"}}],\"fullName\":\"Energistics.Datatypes.ArrayOfDouble\",\"depends\":[]},\"boolean\",\"bytes\"]}],\"fullName\":\"Energistics.Datatypes.DataValue\",\"depends\":[\"Energistics.Datatypes.ArrayOfDouble\"]}}}],\"fullName\":\"Energistics.Datatypes.SupportedProtocol\",\"depends\":[\"Energistics.Datatypes.Version\",\"Energistics.Datatypes.DataValue\"]}}},{\"name\":\"supportedObjects\",\"type\":{\"type\":\"array\",\"items\":\"string\"}}],\"messageType\":\"2\",\"protocol\":\"0\",\"senderRole\":\"server\",\"protocolRoles\":\"client,server\",\"fullName\":\"Energistics.Protocol.Core.OpenSession\",\"depends\":[\"Energistics.Datatypes.SupportedProtocol\"]}");

    public static org.apache.avro.Schema getClassSchema() {
        return SCHEMA$;
    }

    private static SpecificData MODEL$ = new SpecificData();

    private static final BinaryMessageEncoder ENCODER =
            new BinaryMessageEncoder(MODEL$, SCHEMA$);

    private static final BinaryMessageDecoder DECODER =
            new BinaryMessageDecoder(MODEL$, SCHEMA$);

    /**
     * Return the BinaryMessageDecoder instance used by this class.
     */
    public static BinaryMessageDecoder getDecoder() {
        return DECODER;
    }

    /**
     * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
     *
     * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
     */
    public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
        return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
    }

    /**
     * Serializes this OpenSession to a ByteBuffer.
     */
    public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
        return ENCODER.encode(this);
    }

    /**
     * Deserializes a OpenSession from a ByteBuffer.
     */
    public static OpenSession fromByteBuffer(
            java.nio.ByteBuffer b) throws java.io.IOException {
        return DECODER.decode(b);
    }

    private java.lang.CharSequence applicationName;
    private java.lang.CharSequence applicationVersion;
    private java.lang.CharSequence sessionId;
    private java.util.List supportedProtocols;
    private java.util.List supportedObjects;

    /**
     * Default constructor.  Note that this does not initialize fields
     * to their default values from the schema.  If that is desired then
     * one should use newBuilder().
     */
    public OpenSession() {
    }

    /**
     * All-args constructor.
     *
     * @param applicationName    The new value for applicationName
     * @param applicationVersion The new value for applicationVersion
     * @param sessionId          The new value for sessionId
     * @param supportedProtocols The new value for supportedProtocols
     * @param supportedObjects   The new value for supportedObjects
     */
    public OpenSession(java.lang.CharSequence applicationName, java.lang.CharSequence applicationVersion, java.lang.CharSequence sessionId, java.util.List supportedProtocols, java.util.List supportedObjects) {
        this.applicationName = applicationName;
        this.applicationVersion = applicationVersion;
        this.sessionId = sessionId;
        this.supportedProtocols = supportedProtocols;
        this.supportedObjects = supportedObjects;
    }

    public org.apache.avro.Schema getSchema() {
        return SCHEMA$;
    }

    // Used by DatumWriter.  Applications should not call.
    public java.lang.Object get(int field$) {
        switch (field$) {
            case 0:
                return applicationName;
            case 1:
                return applicationVersion;
            case 2:
                return sessionId;
            case 3:
                return supportedProtocols;
            case 4:
                return supportedObjects;
            default:
                throw new org.apache.avro.AvroRuntimeException("Bad index");
        }
    }

    // Used by DatumReader.  Applications should not call.
    @SuppressWarnings(value = "unchecked")
    public void put(int field$, java.lang.Object value$) {
        switch (field$) {
            case 0:
                applicationName = (java.lang.CharSequence) value$;
                break;
            case 1:
                applicationVersion = (java.lang.CharSequence) value$;
                break;
            case 2:
                sessionId = (java.lang.CharSequence) value$;
                break;
            case 3:
                supportedProtocols = (java.util.List) value$;
                break;
            case 4:
                supportedObjects = (java.util.List) value$;
                break;
            default:
                throw new org.apache.avro.AvroRuntimeException("Bad index");
        }
    }

    /**
     * Gets the value of the 'applicationName' field.
     *
     * @return The value of the 'applicationName' field.
     */
    public java.lang.CharSequence getApplicationName() {
        return applicationName;
    }

    /**
     * Sets the value of the 'applicationName' field.
     *
     * @param value the value to set.
     */
    public void setApplicationName(java.lang.CharSequence value) {
        this.applicationName = value;
    }

    /**
     * Gets the value of the 'applicationVersion' field.
     *
     * @return The value of the 'applicationVersion' field.
     */
    public java.lang.CharSequence getApplicationVersion() {
        return applicationVersion;
    }

    /**
     * Sets the value of the 'applicationVersion' field.
     *
     * @param value the value to set.
     */
    public void setApplicationVersion(java.lang.CharSequence value) {
        this.applicationVersion = value;
    }

    /**
     * Gets the value of the 'sessionId' field.
     *
     * @return The value of the 'sessionId' field.
     */
    public java.lang.CharSequence getSessionId() {
        return sessionId;
    }

    /**
     * Sets the value of the 'sessionId' field.
     *
     * @param value the value to set.
     */
    public void setSessionId(java.lang.CharSequence value) {
        this.sessionId = value;
    }

    /**
     * Gets the value of the 'supportedProtocols' field.
     *
     * @return The value of the 'supportedProtocols' field.
     */
    public java.util.List getSupportedProtocols() {
        return supportedProtocols;
    }

    /**
     * Sets the value of the 'supportedProtocols' field.
     *
     * @param value the value to set.
     */
    public void setSupportedProtocols(java.util.List value) {
        this.supportedProtocols = value;
    }

    /**
     * Gets the value of the 'supportedObjects' field.
     *
     * @return The value of the 'supportedObjects' field.
     */
    public java.util.List getSupportedObjects() {
        return supportedObjects;
    }

    /**
     * Sets the value of the 'supportedObjects' field.
     *
     * @param value the value to set.
     */
    public void setSupportedObjects(java.util.List value) {
        this.supportedObjects = value;
    }

    /**
     * Creates a new OpenSession RecordBuilder.
     *
     * @return A new OpenSession RecordBuilder
     */
    public static Energistics.Protocol.Core.OpenSession.Builder newBuilder() {
        return new Energistics.Protocol.Core.OpenSession.Builder();
    }

    /**
     * Creates a new OpenSession RecordBuilder by copying an existing Builder.
     *
     * @param other The existing builder to copy.
     * @return A new OpenSession RecordBuilder
     */
    public static Energistics.Protocol.Core.OpenSession.Builder newBuilder(Energistics.Protocol.Core.OpenSession.Builder other) {
        return new Energistics.Protocol.Core.OpenSession.Builder(other);
    }

    /**
     * Creates a new OpenSession RecordBuilder by copying an existing OpenSession instance.
     *
     * @param other The existing instance to copy.
     * @return A new OpenSession RecordBuilder
     */
    public static Energistics.Protocol.Core.OpenSession.Builder newBuilder(Energistics.Protocol.Core.OpenSession other) {
        return new Energistics.Protocol.Core.OpenSession.Builder(other);
    }

    /**
     * RecordBuilder for OpenSession instances.
     */
    public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
            implements org.apache.avro.data.RecordBuilder {

        private java.lang.CharSequence applicationName;
        private java.lang.CharSequence applicationVersion;
        private java.lang.CharSequence sessionId;
        private java.util.List supportedProtocols;
        private java.util.List supportedObjects;

        /** Creates a new Builder */
        private Builder() {
            super(SCHEMA$);
        }

        /**
         * Creates a Builder by copying an existing Builder.
         * @param other The existing Builder to copy.
         */
        private Builder(Energistics.Protocol.Core.OpenSession.Builder other) {
            super(other);
            if (isValidValue(fields()[0], other.applicationName)) {
                this.applicationName = data().deepCopy(fields()[0].schema(), other.applicationName);
                fieldSetFlags()[0] = true;
            }
            if (isValidValue(fields()[1], other.applicationVersion)) {
                this.applicationVersion = data().deepCopy(fields()[1].schema(), other.applicationVersion);
                fieldSetFlags()[1] = true;
            }
            if (isValidValue(fields()[2], other.sessionId)) {
                this.sessionId = data().deepCopy(fields()[2].schema(), other.sessionId);
                fieldSetFlags()[2] = true;
            }
            if (isValidValue(fields()[3], other.supportedProtocols)) {
                this.supportedProtocols = data().deepCopy(fields()[3].schema(), other.supportedProtocols);
                fieldSetFlags()[3] = true;
            }
            if (isValidValue(fields()[4], other.supportedObjects)) {
                this.supportedObjects = data().deepCopy(fields()[4].schema(), other.supportedObjects);
                fieldSetFlags()[4] = true;
            }
        }

        /**
         * Creates a Builder by copying an existing OpenSession instance
         *
         * @param other The existing instance to copy.
         */
        private Builder(Energistics.Protocol.Core.OpenSession other) {
            super(SCHEMA$);
            if (isValidValue(fields()[0], other.applicationName)) {
                this.applicationName = data().deepCopy(fields()[0].schema(), other.applicationName);
                fieldSetFlags()[0] = true;
            }
            if (isValidValue(fields()[1], other.applicationVersion)) {
                this.applicationVersion = data().deepCopy(fields()[1].schema(), other.applicationVersion);
                fieldSetFlags()[1] = true;
            }
            if (isValidValue(fields()[2], other.sessionId)) {
                this.sessionId = data().deepCopy(fields()[2].schema(), other.sessionId);
                fieldSetFlags()[2] = true;
            }
            if (isValidValue(fields()[3], other.supportedProtocols)) {
                this.supportedProtocols = data().deepCopy(fields()[3].schema(), other.supportedProtocols);
                fieldSetFlags()[3] = true;
            }
            if (isValidValue(fields()[4], other.supportedObjects)) {
                this.supportedObjects = data().deepCopy(fields()[4].schema(), other.supportedObjects);
                fieldSetFlags()[4] = true;
            }
        }

        /**
         * Gets the value of the 'applicationName' field.
         *
         * @return The value.
         */
        public java.lang.CharSequence getApplicationName() {
            return applicationName;
        }

        /**
         * Sets the value of the 'applicationName' field.
         *
         * @param value The value of 'applicationName'.
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder setApplicationName(java.lang.CharSequence value) {
            validate(fields()[0], value);
            this.applicationName = value;
            fieldSetFlags()[0] = true;
            return this;
        }

        /**
         * Checks whether the 'applicationName' field has been set.
         *
         * @return True if the 'applicationName' field has been set, false otherwise.
         */
        public boolean hasApplicationName() {
            return fieldSetFlags()[0];
        }


        /**
         * Clears the value of the 'applicationName' field.
         *
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder clearApplicationName() {
            applicationName = null;
            fieldSetFlags()[0] = false;
            return this;
        }

        /**
         * Gets the value of the 'applicationVersion' field.
         *
         * @return The value.
         */
        public java.lang.CharSequence getApplicationVersion() {
            return applicationVersion;
        }

        /**
         * Sets the value of the 'applicationVersion' field.
         *
         * @param value The value of 'applicationVersion'.
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder setApplicationVersion(java.lang.CharSequence value) {
            validate(fields()[1], value);
            this.applicationVersion = value;
            fieldSetFlags()[1] = true;
            return this;
        }

        /**
         * Checks whether the 'applicationVersion' field has been set.
         *
         * @return True if the 'applicationVersion' field has been set, false otherwise.
         */
        public boolean hasApplicationVersion() {
            return fieldSetFlags()[1];
        }


        /**
         * Clears the value of the 'applicationVersion' field.
         *
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder clearApplicationVersion() {
            applicationVersion = null;
            fieldSetFlags()[1] = false;
            return this;
        }

        /**
         * Gets the value of the 'sessionId' field.
         *
         * @return The value.
         */
        public java.lang.CharSequence getSessionId() {
            return sessionId;
        }

        /**
         * Sets the value of the 'sessionId' field.
         *
         * @param value The value of 'sessionId'.
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder setSessionId(java.lang.CharSequence value) {
            validate(fields()[2], value);
            this.sessionId = value;
            fieldSetFlags()[2] = true;
            return this;
        }

        /**
         * Checks whether the 'sessionId' field has been set.
         *
         * @return True if the 'sessionId' field has been set, false otherwise.
         */
        public boolean hasSessionId() {
            return fieldSetFlags()[2];
        }


        /**
         * Clears the value of the 'sessionId' field.
         *
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder clearSessionId() {
            sessionId = null;
            fieldSetFlags()[2] = false;
            return this;
        }

        /**
         * Gets the value of the 'supportedProtocols' field.
         *
         * @return The value.
         */
        public java.util.List getSupportedProtocols() {
            return supportedProtocols;
        }

        /**
         * Sets the value of the 'supportedProtocols' field.
         *
         * @param value The value of 'supportedProtocols'.
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder setSupportedProtocols(java.util.List value) {
            validate(fields()[3], value);
            this.supportedProtocols = value;
            fieldSetFlags()[3] = true;
            return this;
        }

        /**
         * Checks whether the 'supportedProtocols' field has been set.
         *
         * @return True if the 'supportedProtocols' field has been set, false otherwise.
         */
        public boolean hasSupportedProtocols() {
            return fieldSetFlags()[3];
        }


        /**
         * Clears the value of the 'supportedProtocols' field.
         *
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder clearSupportedProtocols() {
            supportedProtocols = null;
            fieldSetFlags()[3] = false;
            return this;
        }

        /**
         * Gets the value of the 'supportedObjects' field.
         *
         * @return The value.
         */
        public java.util.List getSupportedObjects() {
            return supportedObjects;
        }

        /**
         * Sets the value of the 'supportedObjects' field.
         *
         * @param value The value of 'supportedObjects'.
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder setSupportedObjects(java.util.List value) {
            validate(fields()[4], value);
            this.supportedObjects = value;
            fieldSetFlags()[4] = true;
            return this;
        }

        /**
         * Checks whether the 'supportedObjects' field has been set.
         *
         * @return True if the 'supportedObjects' field has been set, false otherwise.
         */
        public boolean hasSupportedObjects() {
            return fieldSetFlags()[4];
        }


        /**
         * Clears the value of the 'supportedObjects' field.
         *
         * @return This builder.
         */
        public Energistics.Protocol.Core.OpenSession.Builder clearSupportedObjects() {
            supportedObjects = null;
            fieldSetFlags()[4] = false;
            return this;
        }

        @Override
        @SuppressWarnings("unchecked")
        public OpenSession build() {
            try {
                OpenSession record = new OpenSession();
                record.applicationName = fieldSetFlags()[0] ? this.applicationName : (java.lang.CharSequence) defaultValue(fields()[0]);
                record.applicationVersion = fieldSetFlags()[1] ? this.applicationVersion : (java.lang.CharSequence) defaultValue(fields()[1]);
                record.sessionId = fieldSetFlags()[2] ? this.sessionId : (java.lang.CharSequence) defaultValue(fields()[2]);
                record.supportedProtocols = fieldSetFlags()[3] ? this.supportedProtocols : (java.util.List) defaultValue(fields()[3]);
                record.supportedObjects = fieldSetFlags()[4] ? this.supportedObjects : (java.util.List) defaultValue(fields()[4]);
                return record;
            } catch (java.lang.Exception e) {
                throw new org.apache.avro.AvroRuntimeException(e);
            }
        }
    }

    @SuppressWarnings("unchecked")
    private static final org.apache.avro.io.DatumWriter
            WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$);

    @Override
    public void writeExternal(java.io.ObjectOutput out)
            throws java.io.IOException {
        WRITER$.write(this, SpecificData.getEncoder(out));
    }

    @SuppressWarnings("unchecked")
    private static final org.apache.avro.io.DatumReader
    READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy