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

Energistics.Datatypes.ServerCapabilities Maven / Gradle / Ivy

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

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 ServerCapabilities extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
    private static final long serialVersionUID = -3816121857463105664L;
    public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ServerCapabilities\",\"namespace\":\"Energistics.Datatypes\",\"fields\":[{\"name\":\"applicationName\",\"type\":\"string\"},{\"name\":\"applicationVersion\",\"type\":\"string\"},{\"name\":\"supportedProtocols\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"SupportedProtocol\",\"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\"}},{\"name\":\"contactInformation\",\"type\":{\"type\":\"record\",\"name\":\"Contact\",\"fields\":[{\"name\":\"organizationName\",\"type\":[\"null\",\"string\"]},{\"name\":\"contactName\",\"type\":[\"null\",\"string\"]},{\"name\":\"contactPhone\",\"type\":[\"null\",\"string\"]},{\"name\":\"contactEmail\",\"type\":[\"null\",\"string\"]}],\"fullName\":\"Energistics.Datatypes.Contact\",\"depends\":[]}},{\"name\":\"supportedEncodings\",\"type\":\"string\"}],\"fullName\":\"Energistics.Datatypes.ServerCapabilities\",\"depends\":[\"Energistics.Datatypes.SupportedProtocol\",\"Energistics.Datatypes.Contact\"]}");

    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 ServerCapabilities to a ByteBuffer.
     */
    public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
        return ENCODER.encode(this);
    }

    /**
     * Deserializes a ServerCapabilities from a ByteBuffer.
     */
    public static ServerCapabilities 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.util.List supportedProtocols;
    private java.util.List supportedObjects;
    private Energistics.Datatypes.Contact contactInformation;
    private java.lang.CharSequence supportedEncodings;

    /**
     * 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 ServerCapabilities() {
    }

    /**
     * All-args constructor.
     *
     * @param applicationName    The new value for applicationName
     * @param applicationVersion The new value for applicationVersion
     * @param supportedProtocols The new value for supportedProtocols
     * @param supportedObjects   The new value for supportedObjects
     * @param contactInformation The new value for contactInformation
     * @param supportedEncodings The new value for supportedEncodings
     */
    public ServerCapabilities(java.lang.CharSequence applicationName, java.lang.CharSequence applicationVersion, java.util.List supportedProtocols, java.util.List supportedObjects, Energistics.Datatypes.Contact contactInformation, java.lang.CharSequence supportedEncodings) {
        this.applicationName = applicationName;
        this.applicationVersion = applicationVersion;
        this.supportedProtocols = supportedProtocols;
        this.supportedObjects = supportedObjects;
        this.contactInformation = contactInformation;
        this.supportedEncodings = supportedEncodings;
    }

    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 supportedProtocols;
            case 3:
                return supportedObjects;
            case 4:
                return contactInformation;
            case 5:
                return supportedEncodings;
            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:
                supportedProtocols = (java.util.List) value$;
                break;
            case 3:
                supportedObjects = (java.util.List) value$;
                break;
            case 4:
                contactInformation = (Energistics.Datatypes.Contact) value$;
                break;
            case 5:
                supportedEncodings = (java.lang.CharSequence) 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 '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;
    }

    /**
     * Gets the value of the 'contactInformation' field.
     *
     * @return The value of the 'contactInformation' field.
     */
    public Energistics.Datatypes.Contact getContactInformation() {
        return contactInformation;
    }

    /**
     * Sets the value of the 'contactInformation' field.
     *
     * @param value the value to set.
     */
    public void setContactInformation(Energistics.Datatypes.Contact value) {
        this.contactInformation = value;
    }

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

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

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

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

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

    /**
     * RecordBuilder for ServerCapabilities 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.util.List supportedProtocols;
        private java.util.List supportedObjects;
        private Energistics.Datatypes.Contact contactInformation;
        private Energistics.Datatypes.Contact.Builder contactInformationBuilder;
        private java.lang.CharSequence supportedEncodings;

        /** 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.Datatypes.ServerCapabilities.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.supportedProtocols)) {
                this.supportedProtocols = data().deepCopy(fields()[2].schema(), other.supportedProtocols);
                fieldSetFlags()[2] = true;
            }
            if (isValidValue(fields()[3], other.supportedObjects)) {
                this.supportedObjects = data().deepCopy(fields()[3].schema(), other.supportedObjects);
                fieldSetFlags()[3] = true;
            }
            if (isValidValue(fields()[4], other.contactInformation)) {
                this.contactInformation = data().deepCopy(fields()[4].schema(), other.contactInformation);
                fieldSetFlags()[4] = true;
            }
            if (other.hasContactInformationBuilder()) {
                this.contactInformationBuilder = Energistics.Datatypes.Contact.newBuilder(other.getContactInformationBuilder());
            }
            if (isValidValue(fields()[5], other.supportedEncodings)) {
                this.supportedEncodings = data().deepCopy(fields()[5].schema(), other.supportedEncodings);
                fieldSetFlags()[5] = true;
            }
        }

        /**
         * Creates a Builder by copying an existing ServerCapabilities instance
         *
         * @param other The existing instance to copy.
         */
        private Builder(Energistics.Datatypes.ServerCapabilities 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.supportedProtocols)) {
                this.supportedProtocols = data().deepCopy(fields()[2].schema(), other.supportedProtocols);
                fieldSetFlags()[2] = true;
            }
            if (isValidValue(fields()[3], other.supportedObjects)) {
                this.supportedObjects = data().deepCopy(fields()[3].schema(), other.supportedObjects);
                fieldSetFlags()[3] = true;
            }
            if (isValidValue(fields()[4], other.contactInformation)) {
                this.contactInformation = data().deepCopy(fields()[4].schema(), other.contactInformation);
                fieldSetFlags()[4] = true;
            }
            this.contactInformationBuilder = null;
            if (isValidValue(fields()[5], other.supportedEncodings)) {
                this.supportedEncodings = data().deepCopy(fields()[5].schema(), other.supportedEncodings);
                fieldSetFlags()[5] = 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.Datatypes.ServerCapabilities.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.Datatypes.ServerCapabilities.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.Datatypes.ServerCapabilities.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.Datatypes.ServerCapabilities.Builder clearApplicationVersion() {
            applicationVersion = null;
            fieldSetFlags()[1] = 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.Datatypes.ServerCapabilities.Builder setSupportedProtocols(java.util.List value) {
            validate(fields()[2], value);
            this.supportedProtocols = value;
            fieldSetFlags()[2] = 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()[2];
        }


        /**
         * Clears the value of the 'supportedProtocols' field.
         *
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder clearSupportedProtocols() {
            supportedProtocols = null;
            fieldSetFlags()[2] = 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.Datatypes.ServerCapabilities.Builder setSupportedObjects(java.util.List value) {
            validate(fields()[3], value);
            this.supportedObjects = value;
            fieldSetFlags()[3] = 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()[3];
        }


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

        /**
         * Gets the value of the 'contactInformation' field.
         *
         * @return The value.
         */
        public Energistics.Datatypes.Contact getContactInformation() {
            return contactInformation;
        }

        /**
         * Sets the value of the 'contactInformation' field.
         *
         * @param value The value of 'contactInformation'.
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder setContactInformation(Energistics.Datatypes.Contact value) {
            validate(fields()[4], value);
            this.contactInformationBuilder = null;
            this.contactInformation = value;
            fieldSetFlags()[4] = true;
            return this;
        }

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

        /**
         * Gets the Builder instance for the 'contactInformation' field and creates one if it doesn't exist yet.
         *
         * @return This builder.
         */
        public Energistics.Datatypes.Contact.Builder getContactInformationBuilder() {
            if (contactInformationBuilder == null) {
                if (hasContactInformation()) {
                    setContactInformationBuilder(Energistics.Datatypes.Contact.newBuilder(contactInformation));
                } else {
                    setContactInformationBuilder(Energistics.Datatypes.Contact.newBuilder());
                }
            }
            return contactInformationBuilder;
        }

        /**
         * Sets the Builder instance for the 'contactInformation' field
         *
         * @param value The builder instance that must be set.
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder setContactInformationBuilder(Energistics.Datatypes.Contact.Builder value) {
            clearContactInformation();
            contactInformationBuilder = value;
            return this;
        }

        /**
         * Checks whether the 'contactInformation' field has an active Builder instance
         *
         * @return True if the 'contactInformation' field has an active Builder instance
         */
        public boolean hasContactInformationBuilder() {
            return contactInformationBuilder != null;
        }

        /**
         * Clears the value of the 'contactInformation' field.
         *
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder clearContactInformation() {
            contactInformation = null;
            contactInformationBuilder = null;
            fieldSetFlags()[4] = false;
            return this;
        }

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

        /**
         * Sets the value of the 'supportedEncodings' field.
         *
         * @param value The value of 'supportedEncodings'.
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder setSupportedEncodings(java.lang.CharSequence value) {
            validate(fields()[5], value);
            this.supportedEncodings = value;
            fieldSetFlags()[5] = true;
            return this;
        }

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


        /**
         * Clears the value of the 'supportedEncodings' field.
         *
         * @return This builder.
         */
        public Energistics.Datatypes.ServerCapabilities.Builder clearSupportedEncodings() {
            supportedEncodings = null;
            fieldSetFlags()[5] = false;
            return this;
        }

        @Override
        @SuppressWarnings("unchecked")
        public ServerCapabilities build() {
            try {
                ServerCapabilities record = new ServerCapabilities();
                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.supportedProtocols = fieldSetFlags()[2] ? this.supportedProtocols : (java.util.List) defaultValue(fields()[2]);
                record.supportedObjects = fieldSetFlags()[3] ? this.supportedObjects : (java.util.List) defaultValue(fields()[3]);
                if (contactInformationBuilder != null) {
                    record.contactInformation = this.contactInformationBuilder.build();
                } else {
                    record.contactInformation = fieldSetFlags()[4] ? this.contactInformation : (Energistics.Datatypes.Contact) defaultValue(fields()[4]);
                }
                record.supportedEncodings = fieldSetFlags()[5] ? this.supportedEncodings : (java.lang.CharSequence) defaultValue(fields()[5]);
                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