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

Energistics.Protocol.ChannelStreaming.ChannelRemove Maven / Gradle / Ivy

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

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class ChannelRemove extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -4204501434274821974L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ChannelRemove\",\"namespace\":\"Energistics.Protocol.ChannelStreaming\",\"fields\":[{\"name\":\"channelId\",\"type\":\"long\"},{\"name\":\"removeReason\",\"type\":[\"null\",\"string\"]}],\"messageType\":\"8\",\"protocol\":\"1\",\"senderRole\":\"producer\",\"protocolRoles\":\"producer,consumer\",\"fullName\":\"Energistics.Protocol.ChannelStreaming.ChannelRemove\",\"depends\":[]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public long channelId;
  @Deprecated public java.lang.CharSequence removeReason;

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

  /**
   * All-args constructor.
   * @param channelId The new value for channelId
   * @param removeReason The new value for removeReason
   */
  public ChannelRemove(java.lang.Long channelId, java.lang.CharSequence removeReason) {
    this.channelId = channelId;
    this.removeReason = removeReason;
  }

  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 channelId;
    case 1: return removeReason;
    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: channelId = (java.lang.Long)value$; break;
    case 1: removeReason = (java.lang.CharSequence)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'channelId' field.
   * @return The value of the 'channelId' field.
   */
  public java.lang.Long getChannelId() {
    return channelId;
  }

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

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

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

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

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

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

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

    private long channelId;
    private java.lang.CharSequence removeReason;

    /** 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.ChannelStreaming.ChannelRemove.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.channelId)) {
        this.channelId = data().deepCopy(fields()[0].schema(), other.channelId);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.removeReason)) {
        this.removeReason = data().deepCopy(fields()[1].schema(), other.removeReason);
        fieldSetFlags()[1] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing ChannelRemove instance
     * @param other The existing instance to copy.
     */
    private Builder(Energistics.Protocol.ChannelStreaming.ChannelRemove other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.channelId)) {
        this.channelId = data().deepCopy(fields()[0].schema(), other.channelId);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.removeReason)) {
        this.removeReason = data().deepCopy(fields()[1].schema(), other.removeReason);
        fieldSetFlags()[1] = true;
      }
    }

    /**
      * Gets the value of the 'channelId' field.
      * @return The value.
      */
    public java.lang.Long getChannelId() {
      return channelId;
    }

    /**
      * Sets the value of the 'channelId' field.
      * @param value The value of 'channelId'.
      * @return This builder.
      */
    public Energistics.Protocol.ChannelStreaming.ChannelRemove.Builder setChannelId(long value) {
      validate(fields()[0], value);
      this.channelId = value;
      fieldSetFlags()[0] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'channelId' field.
      * @return This builder.
      */
    public Energistics.Protocol.ChannelStreaming.ChannelRemove.Builder clearChannelId() {
      fieldSetFlags()[0] = false;
      return this;
    }

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

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

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


    /**
      * Clears the value of the 'removeReason' field.
      * @return This builder.
      */
    public Energistics.Protocol.ChannelStreaming.ChannelRemove.Builder clearRemoveReason() {
      removeReason = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public ChannelRemove build() {
      try {
        ChannelRemove record = new ChannelRemove();
        record.channelId = fieldSetFlags()[0] ? this.channelId : (java.lang.Long) defaultValue(fields()[0]);
        record.removeReason = fieldSetFlags()[1] ? this.removeReason : (java.lang.CharSequence) defaultValue(fields()[1]);
        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