TPropertyVal.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

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

  private static final org.apache.thrift.protocol.TField STR_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("strVal", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField INT_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("intVal", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField LONG_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("longVal", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.BOOL, (short)4);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String strVal; // optional
  public int intVal; // optional
  public long longVal; // optional
  public boolean boolVal; // 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 {
    STR_VAL((short)1, "strVal"),
    INT_VAL((short)2, "intVal"),
    LONG_VAL((short)3, "longVal"),
    BOOL_VAL((short)4, "boolVal");

    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: // STR_VAL
          return STR_VAL;
        case 2: // INT_VAL
          return INT_VAL;
        case 3: // LONG_VAL
          return LONG_VAL;
        case 4: // BOOL_VAL
          return BOOL_VAL;
        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 int __INTVAL_ISSET_ID = 0;
  private static final int __LONGVAL_ISSET_ID = 1;
  private static final int __BOOLVAL_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.STR_VAL,_Fields.INT_VAL,_Fields.LONG_VAL,_Fields.BOOL_VAL};
  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.STR_VAL, new org.apache.thrift.meta_data.FieldMetaData("strVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INT_VAL, new org.apache.thrift.meta_data.FieldMetaData("intVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.LONG_VAL, new org.apache.thrift.meta_data.FieldMetaData("longVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPropertyVal.class, metaDataMap);
  }

  public TPropertyVal() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TPropertyVal(TPropertyVal other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetStrVal()) {
      this.strVal = other.strVal;
    }
    this.intVal = other.intVal;
    this.longVal = other.longVal;
    this.boolVal = other.boolVal;
  }

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

  @Override
  public void clear() {
    this.strVal = null;
    setIntValIsSet(false);
    this.intVal = 0;
    setLongValIsSet(false);
    this.longVal = 0;
    setBoolValIsSet(false);
    this.boolVal = false;
  }

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

  public TPropertyVal setStrVal(@org.apache.thrift.annotation.Nullable java.lang.String strVal) {
    this.strVal = strVal;
    return this;
  }

  public void unsetStrVal() {
    this.strVal = null;
  }

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

  public void setStrValIsSet(boolean value) {
    if (!value) {
      this.strVal = null;
    }
  }

  public int getIntVal() {
    return this.intVal;
  }

  public TPropertyVal setIntVal(int intVal) {
    this.intVal = intVal;
    setIntValIsSet(true);
    return this;
  }

  public void unsetIntVal() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INTVAL_ISSET_ID);
  }

  /** Returns true if field intVal is set (has been assigned a value) and false otherwise */
  public boolean isSetIntVal() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INTVAL_ISSET_ID);
  }

  public void setIntValIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INTVAL_ISSET_ID, value);
  }

  public long getLongVal() {
    return this.longVal;
  }

  public TPropertyVal setLongVal(long longVal) {
    this.longVal = longVal;
    setLongValIsSet(true);
    return this;
  }

  public void unsetLongVal() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LONGVAL_ISSET_ID);
  }

  /** Returns true if field longVal is set (has been assigned a value) and false otherwise */
  public boolean isSetLongVal() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LONGVAL_ISSET_ID);
  }

  public void setLongValIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LONGVAL_ISSET_ID, value);
  }

  public boolean isBoolVal() {
    return this.boolVal;
  }

  public TPropertyVal setBoolVal(boolean boolVal) {
    this.boolVal = boolVal;
    setBoolValIsSet(true);
    return this;
  }

  public void unsetBoolVal() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BOOLVAL_ISSET_ID);
  }

  /** Returns true if field boolVal is set (has been assigned a value) and false otherwise */
  public boolean isSetBoolVal() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BOOLVAL_ISSET_ID);
  }

  public void setBoolValIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BOOLVAL_ISSET_ID, value);
  }

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

    case INT_VAL:
      if (value == null) {
        unsetIntVal();
      } else {
        setIntVal((java.lang.Integer)value);
      }
      break;

    case LONG_VAL:
      if (value == null) {
        unsetLongVal();
      } else {
        setLongVal((java.lang.Long)value);
      }
      break;

    case BOOL_VAL:
      if (value == null) {
        unsetBoolVal();
      } else {
        setBoolVal((java.lang.Boolean)value);
      }
      break;

    }
  }

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

    case INT_VAL:
      return getIntVal();

    case LONG_VAL:
      return getLongVal();

    case BOOL_VAL:
      return isBoolVal();

    }
    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 STR_VAL:
      return isSetStrVal();
    case INT_VAL:
      return isSetIntVal();
    case LONG_VAL:
      return isSetLongVal();
    case BOOL_VAL:
      return isSetBoolVal();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_strVal = true && this.isSetStrVal();
    boolean that_present_strVal = true && that.isSetStrVal();
    if (this_present_strVal || that_present_strVal) {
      if (!(this_present_strVal && that_present_strVal))
        return false;
      if (!this.strVal.equals(that.strVal))
        return false;
    }

    boolean this_present_intVal = true && this.isSetIntVal();
    boolean that_present_intVal = true && that.isSetIntVal();
    if (this_present_intVal || that_present_intVal) {
      if (!(this_present_intVal && that_present_intVal))
        return false;
      if (this.intVal != that.intVal)
        return false;
    }

    boolean this_present_longVal = true && this.isSetLongVal();
    boolean that_present_longVal = true && that.isSetLongVal();
    if (this_present_longVal || that_present_longVal) {
      if (!(this_present_longVal && that_present_longVal))
        return false;
      if (this.longVal != that.longVal)
        return false;
    }

    boolean this_present_boolVal = true && this.isSetBoolVal();
    boolean that_present_boolVal = true && that.isSetBoolVal();
    if (this_present_boolVal || that_present_boolVal) {
      if (!(this_present_boolVal && that_present_boolVal))
        return false;
      if (this.boolVal != that.boolVal)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetStrVal()) ? 131071 : 524287);
    if (isSetStrVal())
      hashCode = hashCode * 8191 + strVal.hashCode();

    hashCode = hashCode * 8191 + ((isSetIntVal()) ? 131071 : 524287);
    if (isSetIntVal())
      hashCode = hashCode * 8191 + intVal;

    hashCode = hashCode * 8191 + ((isSetLongVal()) ? 131071 : 524287);
    if (isSetLongVal())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(longVal);

    hashCode = hashCode * 8191 + ((isSetBoolVal()) ? 131071 : 524287);
    if (isSetBoolVal())
      hashCode = hashCode * 8191 + ((boolVal) ? 131071 : 524287);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetStrVal(), other.isSetStrVal());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStrVal()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.strVal, other.strVal);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIntVal(), other.isSetIntVal());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIntVal()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intVal, other.intVal);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLongVal(), other.isSetLongVal());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLongVal()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.longVal, other.longVal);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBoolVal(), other.isSetBoolVal());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBoolVal()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolVal, other.boolVal);
      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("TPropertyVal(");
    boolean first = true;

    if (isSetStrVal()) {
      sb.append("strVal:");
      if (this.strVal == null) {
        sb.append("null");
      } else {
        sb.append(this.strVal);
      }
      first = false;
    }
    if (isSetIntVal()) {
      if (!first) sb.append(", ");
      sb.append("intVal:");
      sb.append(this.intVal);
      first = false;
    }
    if (isSetLongVal()) {
      if (!first) sb.append(", ");
      sb.append("longVal:");
      sb.append(this.longVal);
      first = false;
    }
    if (isSetBoolVal()) {
      if (!first) sb.append(", ");
      sb.append("boolVal:");
      sb.append(this.boolVal);
      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 {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      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 TPropertyValStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TPropertyValStandardScheme getScheme() {
      return new TPropertyValStandardScheme();
    }
  }

  private static class TPropertyValStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPropertyVal> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TPropertyVal 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: // STR_VAL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.strVal = iprot.readString();
              struct.setStrValIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // INT_VAL
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.intVal = iprot.readI32();
              struct.setIntValIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LONG_VAL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.longVal = iprot.readI64();
              struct.setLongValIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // BOOL_VAL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.boolVal = iprot.readBool();
              struct.setBoolValIsSet(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, TPropertyVal struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.strVal != null) {
        if (struct.isSetStrVal()) {
          oprot.writeFieldBegin(STR_VAL_FIELD_DESC);
          oprot.writeString(struct.strVal);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetIntVal()) {
        oprot.writeFieldBegin(INT_VAL_FIELD_DESC);
        oprot.writeI32(struct.intVal);
        oprot.writeFieldEnd();
      }
      if (struct.isSetLongVal()) {
        oprot.writeFieldBegin(LONG_VAL_FIELD_DESC);
        oprot.writeI64(struct.longVal);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBoolVal()) {
        oprot.writeFieldBegin(BOOL_VAL_FIELD_DESC);
        oprot.writeBool(struct.boolVal);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TPropertyValTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPropertyVal> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPropertyVal 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.isSetStrVal()) {
        optionals.set(0);
      }
      if (struct.isSetIntVal()) {
        optionals.set(1);
      }
      if (struct.isSetLongVal()) {
        optionals.set(2);
      }
      if (struct.isSetBoolVal()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetStrVal()) {
        oprot.writeString(struct.strVal);
      }
      if (struct.isSetIntVal()) {
        oprot.writeI32(struct.intVal);
      }
      if (struct.isSetLongVal()) {
        oprot.writeI64(struct.longVal);
      }
      if (struct.isSetBoolVal()) {
        oprot.writeBool(struct.boolVal);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPropertyVal struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.strVal = iprot.readString();
        struct.setStrValIsSet(true);
      }
      if (incoming.get(1)) {
        struct.intVal = iprot.readI32();
        struct.setIntValIsSet(true);
      }
      if (incoming.get(2)) {
        struct.longVal = iprot.readI64();
        struct.setLongValIsSet(true);
      }
      if (incoming.get(3)) {
        struct.boolVal = iprot.readBool();
        struct.setBoolValIsSet(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();
  }
}