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

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

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

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class RequestSession extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -2614263921756085101L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RequestSession\",\"namespace\":\"Energistics.Protocol.Core\",\"fields\":[{\"name\":\"applicationName\",\"type\":\"string\"},{\"name\":\"applicationVersion\",\"type\":\"string\"},{\"name\":\"requestedProtocols\",\"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\":\"1\",\"protocol\":\"0\",\"senderRole\":\"client\",\"protocolRoles\":\"client,server\",\"fullName\":\"Energistics.Protocol.Core.RequestSession\",\"depends\":[\"Energistics.Datatypes.SupportedProtocol\"]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.CharSequence applicationName;
  @Deprecated public java.lang.CharSequence applicationVersion;
  @Deprecated public java.util.List requestedProtocols;
  @Deprecated public 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 RequestSession() {}

  /**
   * All-args constructor.
   * @param applicationName The new value for applicationName
   * @param applicationVersion The new value for applicationVersion
   * @param requestedProtocols The new value for requestedProtocols
   * @param supportedObjects The new value for supportedObjects
   */
  public RequestSession(java.lang.CharSequence applicationName, java.lang.CharSequence applicationVersion, java.util.List requestedProtocols, java.util.List supportedObjects) {
    this.applicationName = applicationName;
    this.applicationVersion = applicationVersion;
    this.requestedProtocols = requestedProtocols;
    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 requestedProtocols;
    case 3: 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: requestedProtocols = (java.util.List)value$; break;
    case 3: 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 'requestedProtocols' field.
   * @return The value of the 'requestedProtocols' field.
   */
  public java.util.List getRequestedProtocols() {
    return requestedProtocols;
  }

  /**
   * Sets the value of the 'requestedProtocols' field.
   * @param value the value to set.
   */
  public void setRequestedProtocols(java.util.List value) {
    this.requestedProtocols = 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 RequestSession RecordBuilder.
   * @return A new RequestSession RecordBuilder
   */
  public static Energistics.Protocol.Core.RequestSession.Builder newBuilder() {
    return new Energistics.Protocol.Core.RequestSession.Builder();
  }

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

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

  /**
   * RecordBuilder for RequestSession 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 requestedProtocols;
    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.RequestSession.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.requestedProtocols)) {
        this.requestedProtocols = data().deepCopy(fields()[2].schema(), other.requestedProtocols);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.supportedObjects)) {
        this.supportedObjects = data().deepCopy(fields()[3].schema(), other.supportedObjects);
        fieldSetFlags()[3] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing RequestSession instance
     * @param other The existing instance to copy.
     */
    private Builder(Energistics.Protocol.Core.RequestSession 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.requestedProtocols)) {
        this.requestedProtocols = data().deepCopy(fields()[2].schema(), other.requestedProtocols);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.supportedObjects)) {
        this.supportedObjects = data().deepCopy(fields()[3].schema(), other.supportedObjects);
        fieldSetFlags()[3] = 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.RequestSession.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.RequestSession.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.RequestSession.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.RequestSession.Builder clearApplicationVersion() {
      applicationVersion = null;
      fieldSetFlags()[1] = false;
      return this;
    }

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

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

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


    /**
      * Clears the value of the 'requestedProtocols' field.
      * @return This builder.
      */
    public Energistics.Protocol.Core.RequestSession.Builder clearRequestedProtocols() {
      requestedProtocols = 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.Protocol.Core.RequestSession.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.Protocol.Core.RequestSession.Builder clearSupportedObjects() {
      supportedObjects = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    @Override
    public RequestSession build() {
      try {
        RequestSession record = new RequestSession();
        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.requestedProtocols = fieldSetFlags()[2] ? this.requestedProtocols : (java.util.List) defaultValue(fields()[2]);
        record.supportedObjects = fieldSetFlags()[3] ? this.supportedObjects : (java.util.List) defaultValue(fields()[3]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  private static final org.apache.avro.io.DatumWriter
    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);

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

  private static final org.apache.avro.io.DatumReader
    READER$ = new org.apache.avro.specific.SpecificDatumReader(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