TTVFNumbersScanRange.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 TTVFNumbersScanRange implements org.apache.thrift.TBase<TTVFNumbersScanRange, TTVFNumbersScanRange._Fields>, java.io.Serializable, Cloneable, Comparable<TTVFNumbersScanRange> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTVFNumbersScanRange");

  private static final org.apache.thrift.protocol.TField TOTAL_NUMBERS_FIELD_DESC = new org.apache.thrift.protocol.TField("totalNumbers", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField USE_CONST_FIELD_DESC = new org.apache.thrift.protocol.TField("useConst", org.apache.thrift.protocol.TType.BOOL, (short)2);
  private static final org.apache.thrift.protocol.TField CONST_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("constValue", org.apache.thrift.protocol.TType.I64, (short)3);

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

  public long totalNumbers; // optional
  public boolean useConst; // optional
  public long constValue; // 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 {
    TOTAL_NUMBERS((short)1, "totalNumbers"),
    USE_CONST((short)2, "useConst"),
    CONST_VALUE((short)3, "constValue");

    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: // TOTAL_NUMBERS
          return TOTAL_NUMBERS;
        case 2: // USE_CONST
          return USE_CONST;
        case 3: // CONST_VALUE
          return CONST_VALUE;
        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 __TOTALNUMBERS_ISSET_ID = 0;
  private static final int __USECONST_ISSET_ID = 1;
  private static final int __CONSTVALUE_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.TOTAL_NUMBERS,_Fields.USE_CONST,_Fields.CONST_VALUE};
  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.TOTAL_NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("totalNumbers", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.USE_CONST, new org.apache.thrift.meta_data.FieldMetaData("useConst", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.CONST_VALUE, new org.apache.thrift.meta_data.FieldMetaData("constValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTVFNumbersScanRange.class, metaDataMap);
  }

  public TTVFNumbersScanRange() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TTVFNumbersScanRange(TTVFNumbersScanRange other) {
    __isset_bitfield = other.__isset_bitfield;
    this.totalNumbers = other.totalNumbers;
    this.useConst = other.useConst;
    this.constValue = other.constValue;
  }

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

  @Override
  public void clear() {
    setTotalNumbersIsSet(false);
    this.totalNumbers = 0;
    setUseConstIsSet(false);
    this.useConst = false;
    setConstValueIsSet(false);
    this.constValue = 0;
  }

  public long getTotalNumbers() {
    return this.totalNumbers;
  }

  public TTVFNumbersScanRange setTotalNumbers(long totalNumbers) {
    this.totalNumbers = totalNumbers;
    setTotalNumbersIsSet(true);
    return this;
  }

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

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

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

  public boolean isUseConst() {
    return this.useConst;
  }

  public TTVFNumbersScanRange setUseConst(boolean useConst) {
    this.useConst = useConst;
    setUseConstIsSet(true);
    return this;
  }

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

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

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

  public long getConstValue() {
    return this.constValue;
  }

  public TTVFNumbersScanRange setConstValue(long constValue) {
    this.constValue = constValue;
    setConstValueIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TOTAL_NUMBERS:
      if (value == null) {
        unsetTotalNumbers();
      } else {
        setTotalNumbers((java.lang.Long)value);
      }
      break;

    case USE_CONST:
      if (value == null) {
        unsetUseConst();
      } else {
        setUseConst((java.lang.Boolean)value);
      }
      break;

    case CONST_VALUE:
      if (value == null) {
        unsetConstValue();
      } else {
        setConstValue((java.lang.Long)value);
      }
      break;

    }
  }

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

    case USE_CONST:
      return isUseConst();

    case CONST_VALUE:
      return getConstValue();

    }
    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 TOTAL_NUMBERS:
      return isSetTotalNumbers();
    case USE_CONST:
      return isSetUseConst();
    case CONST_VALUE:
      return isSetConstValue();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_totalNumbers = true && this.isSetTotalNumbers();
    boolean that_present_totalNumbers = true && that.isSetTotalNumbers();
    if (this_present_totalNumbers || that_present_totalNumbers) {
      if (!(this_present_totalNumbers && that_present_totalNumbers))
        return false;
      if (this.totalNumbers != that.totalNumbers)
        return false;
    }

    boolean this_present_useConst = true && this.isSetUseConst();
    boolean that_present_useConst = true && that.isSetUseConst();
    if (this_present_useConst || that_present_useConst) {
      if (!(this_present_useConst && that_present_useConst))
        return false;
      if (this.useConst != that.useConst)
        return false;
    }

    boolean this_present_constValue = true && this.isSetConstValue();
    boolean that_present_constValue = true && that.isSetConstValue();
    if (this_present_constValue || that_present_constValue) {
      if (!(this_present_constValue && that_present_constValue))
        return false;
      if (this.constValue != that.constValue)
        return false;
    }

    return true;
  }

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

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

    hashCode = hashCode * 8191 + ((isSetUseConst()) ? 131071 : 524287);
    if (isSetUseConst())
      hashCode = hashCode * 8191 + ((useConst) ? 131071 : 524287);

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTotalNumbers(), other.isSetTotalNumbers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalNumbers()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalNumbers, other.totalNumbers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUseConst(), other.isSetUseConst());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUseConst()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.useConst, other.useConst);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetConstValue(), other.isSetConstValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConstValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.constValue, other.constValue);
      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("TTVFNumbersScanRange(");
    boolean first = true;

    if (isSetTotalNumbers()) {
      sb.append("totalNumbers:");
      sb.append(this.totalNumbers);
      first = false;
    }
    if (isSetUseConst()) {
      if (!first) sb.append(", ");
      sb.append("useConst:");
      sb.append(this.useConst);
      first = false;
    }
    if (isSetConstValue()) {
      if (!first) sb.append(", ");
      sb.append("constValue:");
      sb.append(this.constValue);
      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 TTVFNumbersScanRangeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TTVFNumbersScanRangeStandardScheme getScheme() {
      return new TTVFNumbersScanRangeStandardScheme();
    }
  }

  private static class TTVFNumbersScanRangeStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTVFNumbersScanRange> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TTVFNumbersScanRange 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: // TOTAL_NUMBERS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.totalNumbers = iprot.readI64();
              struct.setTotalNumbersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // USE_CONST
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.useConst = iprot.readBool();
              struct.setUseConstIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CONST_VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.constValue = iprot.readI64();
              struct.setConstValueIsSet(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, TTVFNumbersScanRange struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetTotalNumbers()) {
        oprot.writeFieldBegin(TOTAL_NUMBERS_FIELD_DESC);
        oprot.writeI64(struct.totalNumbers);
        oprot.writeFieldEnd();
      }
      if (struct.isSetUseConst()) {
        oprot.writeFieldBegin(USE_CONST_FIELD_DESC);
        oprot.writeBool(struct.useConst);
        oprot.writeFieldEnd();
      }
      if (struct.isSetConstValue()) {
        oprot.writeFieldBegin(CONST_VALUE_FIELD_DESC);
        oprot.writeI64(struct.constValue);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TTVFNumbersScanRangeTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTVFNumbersScanRange> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TTVFNumbersScanRange 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.isSetTotalNumbers()) {
        optionals.set(0);
      }
      if (struct.isSetUseConst()) {
        optionals.set(1);
      }
      if (struct.isSetConstValue()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetTotalNumbers()) {
        oprot.writeI64(struct.totalNumbers);
      }
      if (struct.isSetUseConst()) {
        oprot.writeBool(struct.useConst);
      }
      if (struct.isSetConstValue()) {
        oprot.writeI64(struct.constValue);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TTVFNumbersScanRange 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.totalNumbers = iprot.readI64();
        struct.setTotalNumbersIsSet(true);
      }
      if (incoming.get(1)) {
        struct.useConst = iprot.readBool();
        struct.setUseConstIsSet(true);
      }
      if (incoming.get(2)) {
        struct.constValue = iprot.readI64();
        struct.setConstValueIsSet(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();
  }
}