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

org.apache.iotdb.mpp.rpc.thrift.TPushSinglePipeMetaReq 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 TPushSinglePipeMetaReq 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("TPushSinglePipeMetaReq");

  private static final org.apache.thrift.protocol.TField PIPE_META_FIELD_DESC = new org.apache.thrift.protocol.TField("pipeMeta", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField PIPE_NAME_TO_DROP_FIELD_DESC = new org.apache.thrift.protocol.TField("pipeNameToDrop", org.apache.thrift.protocol.TType.STRING, (short)2);

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

  public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer pipeMeta; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String pipeNameToDrop; // 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 {
    PIPE_META((short)1, "pipeMeta"),
    PIPE_NAME_TO_DROP((short)2, "pipeNameToDrop");

    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: // PIPE_META
          return PIPE_META;
        case 2: // PIPE_NAME_TO_DROP
          return PIPE_NAME_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.PIPE_META,_Fields.PIPE_NAME_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.PIPE_META, new org.apache.thrift.meta_data.FieldMetaData("pipeMeta", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    tmpMap.put(_Fields.PIPE_NAME_TO_DROP, new org.apache.thrift.meta_data.FieldMetaData("pipeNameToDrop", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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(TPushSinglePipeMetaReq.class, metaDataMap);
  }

  public TPushSinglePipeMetaReq() {
  }

  /**
   * Performs a deep copy on other.
   */
  public TPushSinglePipeMetaReq(TPushSinglePipeMetaReq other) {
    if (other.isSetPipeMeta()) {
      this.pipeMeta = org.apache.thrift.TBaseHelper.copyBinary(other.pipeMeta);
    }
    if (other.isSetPipeNameToDrop()) {
      this.pipeNameToDrop = other.pipeNameToDrop;
    }
  }

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

  @Override
  public void clear() {
    this.pipeMeta = null;
    this.pipeNameToDrop = null;
  }

  public byte[] getPipeMeta() {
    setPipeMeta(org.apache.thrift.TBaseHelper.rightSize(pipeMeta));
    return pipeMeta == null ? null : pipeMeta.array();
  }

  public java.nio.ByteBuffer bufferForPipeMeta() {
    return org.apache.thrift.TBaseHelper.copyBinary(pipeMeta);
  }

  public TPushSinglePipeMetaReq setPipeMeta(byte[] pipeMeta) {
    this.pipeMeta = pipeMeta == null ? (java.nio.ByteBuffer)null   : java.nio.ByteBuffer.wrap(pipeMeta.clone());
    return this;
  }

  public TPushSinglePipeMetaReq setPipeMeta(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer pipeMeta) {
    this.pipeMeta = org.apache.thrift.TBaseHelper.copyBinary(pipeMeta);
    return this;
  }

  public void unsetPipeMeta() {
    this.pipeMeta = null;
  }

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

  public void setPipeMetaIsSet(boolean value) {
    if (!value) {
      this.pipeMeta = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getPipeNameToDrop() {
    return this.pipeNameToDrop;
  }

  public TPushSinglePipeMetaReq setPipeNameToDrop(@org.apache.thrift.annotation.Nullable java.lang.String pipeNameToDrop) {
    this.pipeNameToDrop = pipeNameToDrop;
    return this;
  }

  public void unsetPipeNameToDrop() {
    this.pipeNameToDrop = null;
  }

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

  public void setPipeNameToDropIsSet(boolean value) {
    if (!value) {
      this.pipeNameToDrop = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case PIPE_META:
      if (value == null) {
        unsetPipeMeta();
      } else {
        if (value instanceof byte[]) {
          setPipeMeta((byte[])value);
        } else {
          setPipeMeta((java.nio.ByteBuffer)value);
        }
      }
      break;

    case PIPE_NAME_TO_DROP:
      if (value == null) {
        unsetPipeNameToDrop();
      } else {
        setPipeNameToDrop((java.lang.String)value);
      }
      break;

    }
  }

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

    case PIPE_NAME_TO_DROP:
      return getPipeNameToDrop();

    }
    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 PIPE_META:
      return isSetPipeMeta();
    case PIPE_NAME_TO_DROP:
      return isSetPipeNameToDrop();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_pipeMeta = true && this.isSetPipeMeta();
    boolean that_present_pipeMeta = true && that.isSetPipeMeta();
    if (this_present_pipeMeta || that_present_pipeMeta) {
      if (!(this_present_pipeMeta && that_present_pipeMeta))
        return false;
      if (!this.pipeMeta.equals(that.pipeMeta))
        return false;
    }

    boolean this_present_pipeNameToDrop = true && this.isSetPipeNameToDrop();
    boolean that_present_pipeNameToDrop = true && that.isSetPipeNameToDrop();
    if (this_present_pipeNameToDrop || that_present_pipeNameToDrop) {
      if (!(this_present_pipeNameToDrop && that_present_pipeNameToDrop))
        return false;
      if (!this.pipeNameToDrop.equals(that.pipeNameToDrop))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetPipeMeta()) ? 131071 : 524287);
    if (isSetPipeMeta())
      hashCode = hashCode * 8191 + pipeMeta.hashCode();

    hashCode = hashCode * 8191 + ((isSetPipeNameToDrop()) ? 131071 : 524287);
    if (isSetPipeNameToDrop())
      hashCode = hashCode * 8191 + pipeNameToDrop.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetPipeMeta(), other.isSetPipeMeta());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPipeMeta()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pipeMeta, other.pipeMeta);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPipeNameToDrop(), other.isSetPipeNameToDrop());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPipeNameToDrop()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pipeNameToDrop, other.pipeNameToDrop);
      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("TPushSinglePipeMetaReq(");
    boolean first = true;

    if (isSetPipeMeta()) {
      sb.append("pipeMeta:");
      if (this.pipeMeta == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.pipeMeta, sb);
      }
      first = false;
    }
    if (isSetPipeNameToDrop()) {
      if (!first) sb.append(", ");
      sb.append("pipeNameToDrop:");
      if (this.pipeNameToDrop == null) {
        sb.append("null");
      } else {
        sb.append(this.pipeNameToDrop);
      }
      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 TPushSinglePipeMetaReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TPushSinglePipeMetaReqStandardScheme getScheme() {
      return new TPushSinglePipeMetaReqStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, TPushSinglePipeMetaReq 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: // PIPE_META
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.pipeMeta = iprot.readBinary();
              struct.setPipeMetaIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PIPE_NAME_TO_DROP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.pipeNameToDrop = iprot.readString();
              struct.setPipeNameToDropIsSet(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, TPushSinglePipeMetaReq struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.pipeMeta != null) {
        if (struct.isSetPipeMeta()) {
          oprot.writeFieldBegin(PIPE_META_FIELD_DESC);
          oprot.writeBinary(struct.pipeMeta);
          oprot.writeFieldEnd();
        }
      }
      if (struct.pipeNameToDrop != null) {
        if (struct.isSetPipeNameToDrop()) {
          oprot.writeFieldBegin(PIPE_NAME_TO_DROP_FIELD_DESC);
          oprot.writeString(struct.pipeNameToDrop);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPushSinglePipeMetaReq 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.isSetPipeMeta()) {
        optionals.set(0);
      }
      if (struct.isSetPipeNameToDrop()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetPipeMeta()) {
        oprot.writeBinary(struct.pipeMeta);
      }
      if (struct.isSetPipeNameToDrop()) {
        oprot.writeString(struct.pipeNameToDrop);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPushSinglePipeMetaReq 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)) {
        struct.pipeMeta = iprot.readBinary();
        struct.setPipeMetaIsSet(true);
      }
      if (incoming.get(1)) {
        struct.pipeNameToDrop = iprot.readString();
        struct.setPipeNameToDropIsSet(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