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

org.apache.iotdb.mpp.rpc.thrift.TPushMultiTopicMetaReq Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.iotdb.mpp.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2024-09-12")
public class TPushMultiTopicMetaReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPushMultiTopicMetaReq");

  private static final org.apache.thrift.protocol.TField TOPIC_METAS_FIELD_DESC = new org.apache.thrift.protocol.TField("topicMetas", org.apache.thrift.protocol.TType.LIST, (short)1);
  private static final org.apache.thrift.protocol.TField TOPIC_NAMES_TO_DROP_FIELD_DESC = new org.apache.thrift.protocol.TField("topicNamesToDrop", org.apache.thrift.protocol.TType.LIST, (short)2);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPushMultiTopicMetaReqStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPushMultiTopicMetaReqTupleSchemeFactory();

  public @org.apache.thrift.annotation.Nullable java.util.List topicMetas; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List topicNamesToDrop; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    TOPIC_METAS((short)1, "topicMetas"),
    TOPIC_NAMES_TO_DROP((short)2, "topicNamesToDrop");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // TOPIC_METAS
          return TOPIC_METAS;
        case 2: // TOPIC_NAMES_TO_DROP
          return TOPIC_NAMES_TO_DROP;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.TOPIC_METAS,_Fields.TOPIC_NAMES_TO_DROP};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.TOPIC_METAS, new org.apache.thrift.meta_data.FieldMetaData("topicMetas", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , true))));
    tmpMap.put(_Fields.TOPIC_NAMES_TO_DROP, new org.apache.thrift.meta_data.FieldMetaData("topicNamesToDrop", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPushMultiTopicMetaReq.class, metaDataMap);
  }

  public TPushMultiTopicMetaReq() {
  }

  /**
   * Performs a deep copy on other.
   */
  public TPushMultiTopicMetaReq(TPushMultiTopicMetaReq other) {
    if (other.isSetTopicMetas()) {
      java.util.List __this__topicMetas = new java.util.ArrayList(other.topicMetas);
      this.topicMetas = __this__topicMetas;
    }
    if (other.isSetTopicNamesToDrop()) {
      java.util.List __this__topicNamesToDrop = new java.util.ArrayList(other.topicNamesToDrop);
      this.topicNamesToDrop = __this__topicNamesToDrop;
    }
  }

  public TPushMultiTopicMetaReq deepCopy() {
    return new TPushMultiTopicMetaReq(this);
  }

  @Override
  public void clear() {
    this.topicMetas = null;
    this.topicNamesToDrop = null;
  }

  public int getTopicMetasSize() {
    return (this.topicMetas == null) ? 0 : this.topicMetas.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getTopicMetasIterator() {
    return (this.topicMetas == null) ? null : this.topicMetas.iterator();
  }

  public void addToTopicMetas(java.nio.ByteBuffer elem) {
    if (this.topicMetas == null) {
      this.topicMetas = new java.util.ArrayList();
    }
    this.topicMetas.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getTopicMetas() {
    return this.topicMetas;
  }

  public TPushMultiTopicMetaReq setTopicMetas(@org.apache.thrift.annotation.Nullable java.util.List topicMetas) {
    this.topicMetas = topicMetas;
    return this;
  }

  public void unsetTopicMetas() {
    this.topicMetas = null;
  }

  /** Returns true if field topicMetas is set (has been assigned a value) and false otherwise */
  public boolean isSetTopicMetas() {
    return this.topicMetas != null;
  }

  public void setTopicMetasIsSet(boolean value) {
    if (!value) {
      this.topicMetas = null;
    }
  }

  public int getTopicNamesToDropSize() {
    return (this.topicNamesToDrop == null) ? 0 : this.topicNamesToDrop.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getTopicNamesToDropIterator() {
    return (this.topicNamesToDrop == null) ? null : this.topicNamesToDrop.iterator();
  }

  public void addToTopicNamesToDrop(java.lang.String elem) {
    if (this.topicNamesToDrop == null) {
      this.topicNamesToDrop = new java.util.ArrayList();
    }
    this.topicNamesToDrop.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getTopicNamesToDrop() {
    return this.topicNamesToDrop;
  }

  public TPushMultiTopicMetaReq setTopicNamesToDrop(@org.apache.thrift.annotation.Nullable java.util.List topicNamesToDrop) {
    this.topicNamesToDrop = topicNamesToDrop;
    return this;
  }

  public void unsetTopicNamesToDrop() {
    this.topicNamesToDrop = null;
  }

  /** Returns true if field topicNamesToDrop is set (has been assigned a value) and false otherwise */
  public boolean isSetTopicNamesToDrop() {
    return this.topicNamesToDrop != null;
  }

  public void setTopicNamesToDropIsSet(boolean value) {
    if (!value) {
      this.topicNamesToDrop = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TOPIC_METAS:
      if (value == null) {
        unsetTopicMetas();
      } else {
        setTopicMetas((java.util.List)value);
      }
      break;

    case TOPIC_NAMES_TO_DROP:
      if (value == null) {
        unsetTopicNamesToDrop();
      } else {
        setTopicNamesToDrop((java.util.List)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case TOPIC_METAS:
      return getTopicMetas();

    case TOPIC_NAMES_TO_DROP:
      return getTopicNamesToDrop();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case TOPIC_METAS:
      return isSetTopicMetas();
    case TOPIC_NAMES_TO_DROP:
      return isSetTopicNamesToDrop();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TPushMultiTopicMetaReq)
      return this.equals((TPushMultiTopicMetaReq)that);
    return false;
  }

  public boolean equals(TPushMultiTopicMetaReq that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_topicMetas = true && this.isSetTopicMetas();
    boolean that_present_topicMetas = true && that.isSetTopicMetas();
    if (this_present_topicMetas || that_present_topicMetas) {
      if (!(this_present_topicMetas && that_present_topicMetas))
        return false;
      if (!this.topicMetas.equals(that.topicMetas))
        return false;
    }

    boolean this_present_topicNamesToDrop = true && this.isSetTopicNamesToDrop();
    boolean that_present_topicNamesToDrop = true && that.isSetTopicNamesToDrop();
    if (this_present_topicNamesToDrop || that_present_topicNamesToDrop) {
      if (!(this_present_topicNamesToDrop && that_present_topicNamesToDrop))
        return false;
      if (!this.topicNamesToDrop.equals(that.topicNamesToDrop))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetTopicMetas()) ? 131071 : 524287);
    if (isSetTopicMetas())
      hashCode = hashCode * 8191 + topicMetas.hashCode();

    hashCode = hashCode * 8191 + ((isSetTopicNamesToDrop()) ? 131071 : 524287);
    if (isSetTopicNamesToDrop())
      hashCode = hashCode * 8191 + topicNamesToDrop.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(TPushMultiTopicMetaReq other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTopicMetas(), other.isSetTopicMetas());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopicMetas()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topicMetas, other.topicMetas);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTopicNamesToDrop(), other.isSetTopicNamesToDrop());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopicNamesToDrop()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topicNamesToDrop, other.topicNamesToDrop);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TPushMultiTopicMetaReq(");
    boolean first = true;

    if (isSetTopicMetas()) {
      sb.append("topicMetas:");
      if (this.topicMetas == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.topicMetas, sb);
      }
      first = false;
    }
    if (isSetTopicNamesToDrop()) {
      if (!first) sb.append(", ");
      sb.append("topicNamesToDrop:");
      if (this.topicNamesToDrop == null) {
        sb.append("null");
      } else {
        sb.append(this.topicNamesToDrop);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TPushMultiTopicMetaReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TPushMultiTopicMetaReqStandardScheme getScheme() {
      return new TPushMultiTopicMetaReqStandardScheme();
    }
  }

  private static class TPushMultiTopicMetaReqStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TPushMultiTopicMetaReq struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // TOPIC_METAS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list430 = iprot.readListBegin();
                struct.topicMetas = new java.util.ArrayList(_list430.size);
                @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem431;
                for (int _i432 = 0; _i432 < _list430.size; ++_i432)
                {
                  _elem431 = iprot.readBinary();
                  struct.topicMetas.add(_elem431);
                }
                iprot.readListEnd();
              }
              struct.setTopicMetasIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TOPIC_NAMES_TO_DROP
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list433 = iprot.readListBegin();
                struct.topicNamesToDrop = new java.util.ArrayList(_list433.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem434;
                for (int _i435 = 0; _i435 < _list433.size; ++_i435)
                {
                  _elem434 = iprot.readString();
                  struct.topicNamesToDrop.add(_elem434);
                }
                iprot.readListEnd();
              }
              struct.setTopicNamesToDropIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TPushMultiTopicMetaReq struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.topicMetas != null) {
        if (struct.isSetTopicMetas()) {
          oprot.writeFieldBegin(TOPIC_METAS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.topicMetas.size()));
            for (java.nio.ByteBuffer _iter436 : struct.topicMetas)
            {
              oprot.writeBinary(_iter436);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.topicNamesToDrop != null) {
        if (struct.isSetTopicNamesToDrop()) {
          oprot.writeFieldBegin(TOPIC_NAMES_TO_DROP_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.topicNamesToDrop.size()));
            for (java.lang.String _iter437 : struct.topicNamesToDrop)
            {
              oprot.writeString(_iter437);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TPushMultiTopicMetaReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TPushMultiTopicMetaReqTupleScheme getScheme() {
      return new TPushMultiTopicMetaReqTupleScheme();
    }
  }

  private static class TPushMultiTopicMetaReqTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPushMultiTopicMetaReq struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetTopicMetas()) {
        optionals.set(0);
      }
      if (struct.isSetTopicNamesToDrop()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetTopicMetas()) {
        {
          oprot.writeI32(struct.topicMetas.size());
          for (java.nio.ByteBuffer _iter438 : struct.topicMetas)
          {
            oprot.writeBinary(_iter438);
          }
        }
      }
      if (struct.isSetTopicNamesToDrop()) {
        {
          oprot.writeI32(struct.topicNamesToDrop.size());
          for (java.lang.String _iter439 : struct.topicNamesToDrop)
          {
            oprot.writeString(_iter439);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPushMultiTopicMetaReq struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list440 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.topicMetas = new java.util.ArrayList(_list440.size);
          @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem441;
          for (int _i442 = 0; _i442 < _list440.size; ++_i442)
          {
            _elem441 = iprot.readBinary();
            struct.topicMetas.add(_elem441);
          }
        }
        struct.setTopicMetasIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list443 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.topicNamesToDrop = new java.util.ArrayList(_list443.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _elem444;
          for (int _i445 = 0; _i445 < _list443.size; ++_i445)
          {
            _elem444 = iprot.readString();
            struct.topicNamesToDrop.add(_elem444);
          }
        }
        struct.setTopicNamesToDropIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy