/**
 * Autogenerated by Thrift Compiler (0.17.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.tim.packet;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.17.0)", date = "2023-02-11")
public class TimPropertyBean implements org.apache.thrift.TBase<TimPropertyBean, TimPropertyBean._Fields>, java.io.Serializable, Cloneable, Comparable<TimPropertyBean> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TimPropertyBean");

  private static final org.apache.thrift.protocol.TField THREAD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("threadId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField INTERFLOW_FIELD_DESC = new org.apache.thrift.protocol.TField("interflow", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField TLS_FIELD_DESC = new org.apache.thrift.protocol.TField("tls", org.apache.thrift.protocol.TType.STRING, (short)3);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String threadId; // optional
  /**
   * 消息合流
   */
  public @org.apache.thrift.annotation.Nullable java.lang.String interflow; // optional
  /**
   * tls
   */
  public @org.apache.thrift.annotation.Nullable java.lang.String tls; // 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 {
    THREAD_ID((short)1, "threadId"),
    /**
     * 消息合流
     */
    INTERFLOW((short)2, "interflow"),
    /**
     * tls
     */
    TLS((short)3, "tls");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    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: // THREAD_ID
          return THREAD_ID;
        case 2: // INTERFLOW
          return INTERFLOW;
        case 3: // TLS
          return TLS;
        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;
    }

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.THREAD_ID,_Fields.INTERFLOW,_Fields.TLS};
  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.THREAD_ID, new org.apache.thrift.meta_data.FieldMetaData("threadId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INTERFLOW, new org.apache.thrift.meta_data.FieldMetaData("interflow", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TLS, new org.apache.thrift.meta_data.FieldMetaData("tls", 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(TimPropertyBean.class, metaDataMap);
  }

  public TimPropertyBean() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TimPropertyBean(TimPropertyBean other) {
    if (other.isSetThreadId()) {
      this.threadId = other.threadId;
    }
    if (other.isSetInterflow()) {
      this.interflow = other.interflow;
    }
    if (other.isSetTls()) {
      this.tls = other.tls;
    }
  }

  @Override
  public TimPropertyBean deepCopy() {
    return new TimPropertyBean(this);
  }

  @Override
  public void clear() {
    this.threadId = null;
    this.interflow = null;
    this.tls = null;
  }

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

  public TimPropertyBean setThreadId(@org.apache.thrift.annotation.Nullable java.lang.String threadId) {
    this.threadId = threadId;
    return this;
  }

  public void unsetThreadId() {
    this.threadId = null;
  }

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

  public void setThreadIdIsSet(boolean value) {
    if (!value) {
      this.threadId = null;
    }
  }

  /**
   * 消息合流
   */
  @org.apache.thrift.annotation.Nullable
  public java.lang.String getInterflow() {
    return this.interflow;
  }

  /**
   * 消息合流
   */
  public TimPropertyBean setInterflow(@org.apache.thrift.annotation.Nullable java.lang.String interflow) {
    this.interflow = interflow;
    return this;
  }

  public void unsetInterflow() {
    this.interflow = null;
  }

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

  public void setInterflowIsSet(boolean value) {
    if (!value) {
      this.interflow = null;
    }
  }

  /**
   * tls
   */
  @org.apache.thrift.annotation.Nullable
  public java.lang.String getTls() {
    return this.tls;
  }

  /**
   * tls
   */
  public TimPropertyBean setTls(@org.apache.thrift.annotation.Nullable java.lang.String tls) {
    this.tls = tls;
    return this;
  }

  public void unsetTls() {
    this.tls = null;
  }

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

  public void setTlsIsSet(boolean value) {
    if (!value) {
      this.tls = null;
    }
  }

  @Override
  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case THREAD_ID:
      if (value == null) {
        unsetThreadId();
      } else {
        setThreadId((java.lang.String)value);
      }
      break;

    case INTERFLOW:
      if (value == null) {
        unsetInterflow();
      } else {
        setInterflow((java.lang.String)value);
      }
      break;

    case TLS:
      if (value == null) {
        unsetTls();
      } else {
        setTls((java.lang.String)value);
      }
      break;

    }
  }

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

    case INTERFLOW:
      return getInterflow();

    case TLS:
      return getTls();

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

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

    switch (field) {
    case THREAD_ID:
      return isSetThreadId();
    case INTERFLOW:
      return isSetInterflow();
    case TLS:
      return isSetTls();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_threadId = true && this.isSetThreadId();
    boolean that_present_threadId = true && that.isSetThreadId();
    if (this_present_threadId || that_present_threadId) {
      if (!(this_present_threadId && that_present_threadId))
        return false;
      if (!this.threadId.equals(that.threadId))
        return false;
    }

    boolean this_present_interflow = true && this.isSetInterflow();
    boolean that_present_interflow = true && that.isSetInterflow();
    if (this_present_interflow || that_present_interflow) {
      if (!(this_present_interflow && that_present_interflow))
        return false;
      if (!this.interflow.equals(that.interflow))
        return false;
    }

    boolean this_present_tls = true && this.isSetTls();
    boolean that_present_tls = true && that.isSetTls();
    if (this_present_tls || that_present_tls) {
      if (!(this_present_tls && that_present_tls))
        return false;
      if (!this.tls.equals(that.tls))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetThreadId()) ? 131071 : 524287);
    if (isSetThreadId())
      hashCode = hashCode * 8191 + threadId.hashCode();

    hashCode = hashCode * 8191 + ((isSetInterflow()) ? 131071 : 524287);
    if (isSetInterflow())
      hashCode = hashCode * 8191 + interflow.hashCode();

    hashCode = hashCode * 8191 + ((isSetTls()) ? 131071 : 524287);
    if (isSetTls())
      hashCode = hashCode * 8191 + tls.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetThreadId(), other.isSetThreadId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThreadId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.threadId, other.threadId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetInterflow(), other.isSetInterflow());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInterflow()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.interflow, other.interflow);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTls(), other.isSetTls());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTls()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tls, other.tls);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

  @Override
  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("TimPropertyBean(");
    boolean first = true;

    if (isSetThreadId()) {
      sb.append("threadId:");
      if (this.threadId == null) {
        sb.append("null");
      } else {
        sb.append(this.threadId);
      }
      first = false;
    }
    if (isSetInterflow()) {
      if (!first) sb.append(", ");
      sb.append("interflow:");
      if (this.interflow == null) {
        sb.append("null");
      } else {
        sb.append(this.interflow);
      }
      first = false;
    }
    if (isSetTls()) {
      if (!first) sb.append(", ");
      sb.append("tls:");
      if (this.tls == null) {
        sb.append("null");
      } else {
        sb.append(this.tls);
      }
      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 TimPropertyBeanStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TimPropertyBeanStandardScheme getScheme() {
      return new TimPropertyBeanStandardScheme();
    }
  }

  private static class TimPropertyBeanStandardScheme extends org.apache.thrift.scheme.StandardScheme<TimPropertyBean> {

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TimPropertyBean 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: // THREAD_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.threadId = iprot.readString();
              struct.setThreadIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // INTERFLOW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.interflow = iprot.readString();
              struct.setInterflowIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TLS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.tls = iprot.readString();
              struct.setTlsIsSet(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();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.threadId != null) {
        if (struct.isSetThreadId()) {
          oprot.writeFieldBegin(THREAD_ID_FIELD_DESC);
          oprot.writeString(struct.threadId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.interflow != null) {
        if (struct.isSetInterflow()) {
          oprot.writeFieldBegin(INTERFLOW_FIELD_DESC);
          oprot.writeString(struct.interflow);
          oprot.writeFieldEnd();
        }
      }
      if (struct.tls != null) {
        if (struct.isSetTls()) {
          oprot.writeFieldBegin(TLS_FIELD_DESC);
          oprot.writeString(struct.tls);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TimPropertyBeanTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TimPropertyBeanTupleScheme getScheme() {
      return new TimPropertyBeanTupleScheme();
    }
  }

  private static class TimPropertyBeanTupleScheme extends org.apache.thrift.scheme.TupleScheme<TimPropertyBean> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TimPropertyBean 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.isSetThreadId()) {
        optionals.set(0);
      }
      if (struct.isSetInterflow()) {
        optionals.set(1);
      }
      if (struct.isSetTls()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetThreadId()) {
        oprot.writeString(struct.threadId);
      }
      if (struct.isSetInterflow()) {
        oprot.writeString(struct.interflow);
      }
      if (struct.isSetTls()) {
        oprot.writeString(struct.tls);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TimPropertyBean struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.threadId = iprot.readString();
        struct.setThreadIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.interflow = iprot.readString();
        struct.setInterflowIsSet(true);
      }
      if (incoming.get(2)) {
        struct.tls = iprot.readString();
        struct.setTlsIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> 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();
  }
}

