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

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

  private static final org.apache.thrift.protocol.TField LICENSE_ISSUE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("licenseIssueTimestamp", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField EXPIRE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("expireTimestamp", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField DATA_NODE_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("dataNodeNum", org.apache.thrift.protocol.TType.I16, (short)4);
  private static final org.apache.thrift.protocol.TField CPU_CORE_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("cpuCoreNum", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField DEVICE_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("deviceNum", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField SENSOR_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("sensorNum", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField DISCONNECTION_FROM_ACTIVE_NODE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("disconnectionFromActiveNodeTime", org.apache.thrift.protocol.TType.I64, (short)8);
  private static final org.apache.thrift.protocol.TField AI_NODE_NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("aiNodeNum", org.apache.thrift.protocol.TType.I16, (short)9);

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

  public long licenseIssueTimestamp; // required
  public long expireTimestamp; // required
  public short dataNodeNum; // required
  public int cpuCoreNum; // required
  public long deviceNum; // required
  public long sensorNum; // required
  public long disconnectionFromActiveNodeTime; // required
  public short aiNodeNum; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    LICENSE_ISSUE_TIMESTAMP((short)1, "licenseIssueTimestamp"),
    EXPIRE_TIMESTAMP((short)2, "expireTimestamp"),
    DATA_NODE_NUM((short)4, "dataNodeNum"),
    CPU_CORE_NUM((short)5, "cpuCoreNum"),
    DEVICE_NUM((short)6, "deviceNum"),
    SENSOR_NUM((short)7, "sensorNum"),
    DISCONNECTION_FROM_ACTIVE_NODE_TIME((short)8, "disconnectionFromActiveNodeTime"),
    AI_NODE_NUM((short)9, "aiNodeNum");

    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: // LICENSE_ISSUE_TIMESTAMP
          return LICENSE_ISSUE_TIMESTAMP;
        case 2: // EXPIRE_TIMESTAMP
          return EXPIRE_TIMESTAMP;
        case 4: // DATA_NODE_NUM
          return DATA_NODE_NUM;
        case 5: // CPU_CORE_NUM
          return CPU_CORE_NUM;
        case 6: // DEVICE_NUM
          return DEVICE_NUM;
        case 7: // SENSOR_NUM
          return SENSOR_NUM;
        case 8: // DISCONNECTION_FROM_ACTIVE_NODE_TIME
          return DISCONNECTION_FROM_ACTIVE_NODE_TIME;
        case 9: // AI_NODE_NUM
          return AI_NODE_NUM;
        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 __LICENSEISSUETIMESTAMP_ISSET_ID = 0;
  private static final int __EXPIRETIMESTAMP_ISSET_ID = 1;
  private static final int __DATANODENUM_ISSET_ID = 2;
  private static final int __CPUCORENUM_ISSET_ID = 3;
  private static final int __DEVICENUM_ISSET_ID = 4;
  private static final int __SENSORNUM_ISSET_ID = 5;
  private static final int __DISCONNECTIONFROMACTIVENODETIME_ISSET_ID = 6;
  private static final int __AINODENUM_ISSET_ID = 7;
  private byte __isset_bitfield = 0;
  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.LICENSE_ISSUE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("licenseIssueTimestamp", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.EXPIRE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("expireTimestamp", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DATA_NODE_NUM, new org.apache.thrift.meta_data.FieldMetaData("dataNodeNum", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.CPU_CORE_NUM, new org.apache.thrift.meta_data.FieldMetaData("cpuCoreNum", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.DEVICE_NUM, new org.apache.thrift.meta_data.FieldMetaData("deviceNum", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SENSOR_NUM, new org.apache.thrift.meta_data.FieldMetaData("sensorNum", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DISCONNECTION_FROM_ACTIVE_NODE_TIME, new org.apache.thrift.meta_data.FieldMetaData("disconnectionFromActiveNodeTime", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AI_NODE_NUM, new org.apache.thrift.meta_data.FieldMetaData("aiNodeNum", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TLicense.class, metaDataMap);
  }

  public TLicense() {
  }

  public TLicense(
    long licenseIssueTimestamp,
    long expireTimestamp,
    short dataNodeNum,
    int cpuCoreNum,
    long deviceNum,
    long sensorNum,
    long disconnectionFromActiveNodeTime,
    short aiNodeNum)
  {
    this();
    this.licenseIssueTimestamp = licenseIssueTimestamp;
    setLicenseIssueTimestampIsSet(true);
    this.expireTimestamp = expireTimestamp;
    setExpireTimestampIsSet(true);
    this.dataNodeNum = dataNodeNum;
    setDataNodeNumIsSet(true);
    this.cpuCoreNum = cpuCoreNum;
    setCpuCoreNumIsSet(true);
    this.deviceNum = deviceNum;
    setDeviceNumIsSet(true);
    this.sensorNum = sensorNum;
    setSensorNumIsSet(true);
    this.disconnectionFromActiveNodeTime = disconnectionFromActiveNodeTime;
    setDisconnectionFromActiveNodeTimeIsSet(true);
    this.aiNodeNum = aiNodeNum;
    setAiNodeNumIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public TLicense(TLicense other) {
    __isset_bitfield = other.__isset_bitfield;
    this.licenseIssueTimestamp = other.licenseIssueTimestamp;
    this.expireTimestamp = other.expireTimestamp;
    this.dataNodeNum = other.dataNodeNum;
    this.cpuCoreNum = other.cpuCoreNum;
    this.deviceNum = other.deviceNum;
    this.sensorNum = other.sensorNum;
    this.disconnectionFromActiveNodeTime = other.disconnectionFromActiveNodeTime;
    this.aiNodeNum = other.aiNodeNum;
  }

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

  @Override
  public void clear() {
    setLicenseIssueTimestampIsSet(false);
    this.licenseIssueTimestamp = 0;
    setExpireTimestampIsSet(false);
    this.expireTimestamp = 0;
    setDataNodeNumIsSet(false);
    this.dataNodeNum = 0;
    setCpuCoreNumIsSet(false);
    this.cpuCoreNum = 0;
    setDeviceNumIsSet(false);
    this.deviceNum = 0;
    setSensorNumIsSet(false);
    this.sensorNum = 0;
    setDisconnectionFromActiveNodeTimeIsSet(false);
    this.disconnectionFromActiveNodeTime = 0;
    setAiNodeNumIsSet(false);
    this.aiNodeNum = 0;
  }

  public long getLicenseIssueTimestamp() {
    return this.licenseIssueTimestamp;
  }

  public TLicense setLicenseIssueTimestamp(long licenseIssueTimestamp) {
    this.licenseIssueTimestamp = licenseIssueTimestamp;
    setLicenseIssueTimestampIsSet(true);
    return this;
  }

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

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

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

  public long getExpireTimestamp() {
    return this.expireTimestamp;
  }

  public TLicense setExpireTimestamp(long expireTimestamp) {
    this.expireTimestamp = expireTimestamp;
    setExpireTimestampIsSet(true);
    return this;
  }

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

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

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

  public short getDataNodeNum() {
    return this.dataNodeNum;
  }

  public TLicense setDataNodeNum(short dataNodeNum) {
    this.dataNodeNum = dataNodeNum;
    setDataNodeNumIsSet(true);
    return this;
  }

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

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

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

  public int getCpuCoreNum() {
    return this.cpuCoreNum;
  }

  public TLicense setCpuCoreNum(int cpuCoreNum) {
    this.cpuCoreNum = cpuCoreNum;
    setCpuCoreNumIsSet(true);
    return this;
  }

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

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

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

  public long getDeviceNum() {
    return this.deviceNum;
  }

  public TLicense setDeviceNum(long deviceNum) {
    this.deviceNum = deviceNum;
    setDeviceNumIsSet(true);
    return this;
  }

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

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

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

  public long getSensorNum() {
    return this.sensorNum;
  }

  public TLicense setSensorNum(long sensorNum) {
    this.sensorNum = sensorNum;
    setSensorNumIsSet(true);
    return this;
  }

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

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

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

  public long getDisconnectionFromActiveNodeTime() {
    return this.disconnectionFromActiveNodeTime;
  }

  public TLicense setDisconnectionFromActiveNodeTime(long disconnectionFromActiveNodeTime) {
    this.disconnectionFromActiveNodeTime = disconnectionFromActiveNodeTime;
    setDisconnectionFromActiveNodeTimeIsSet(true);
    return this;
  }

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

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

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

  public short getAiNodeNum() {
    return this.aiNodeNum;
  }

  public TLicense setAiNodeNum(short aiNodeNum) {
    this.aiNodeNum = aiNodeNum;
    setAiNodeNumIsSet(true);
    return this;
  }

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

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

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

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

    case EXPIRE_TIMESTAMP:
      if (value == null) {
        unsetExpireTimestamp();
      } else {
        setExpireTimestamp((java.lang.Long)value);
      }
      break;

    case DATA_NODE_NUM:
      if (value == null) {
        unsetDataNodeNum();
      } else {
        setDataNodeNum((java.lang.Short)value);
      }
      break;

    case CPU_CORE_NUM:
      if (value == null) {
        unsetCpuCoreNum();
      } else {
        setCpuCoreNum((java.lang.Integer)value);
      }
      break;

    case DEVICE_NUM:
      if (value == null) {
        unsetDeviceNum();
      } else {
        setDeviceNum((java.lang.Long)value);
      }
      break;

    case SENSOR_NUM:
      if (value == null) {
        unsetSensorNum();
      } else {
        setSensorNum((java.lang.Long)value);
      }
      break;

    case DISCONNECTION_FROM_ACTIVE_NODE_TIME:
      if (value == null) {
        unsetDisconnectionFromActiveNodeTime();
      } else {
        setDisconnectionFromActiveNodeTime((java.lang.Long)value);
      }
      break;

    case AI_NODE_NUM:
      if (value == null) {
        unsetAiNodeNum();
      } else {
        setAiNodeNum((java.lang.Short)value);
      }
      break;

    }
  }

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

    case EXPIRE_TIMESTAMP:
      return getExpireTimestamp();

    case DATA_NODE_NUM:
      return getDataNodeNum();

    case CPU_CORE_NUM:
      return getCpuCoreNum();

    case DEVICE_NUM:
      return getDeviceNum();

    case SENSOR_NUM:
      return getSensorNum();

    case DISCONNECTION_FROM_ACTIVE_NODE_TIME:
      return getDisconnectionFromActiveNodeTime();

    case AI_NODE_NUM:
      return getAiNodeNum();

    }
    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 LICENSE_ISSUE_TIMESTAMP:
      return isSetLicenseIssueTimestamp();
    case EXPIRE_TIMESTAMP:
      return isSetExpireTimestamp();
    case DATA_NODE_NUM:
      return isSetDataNodeNum();
    case CPU_CORE_NUM:
      return isSetCpuCoreNum();
    case DEVICE_NUM:
      return isSetDeviceNum();
    case SENSOR_NUM:
      return isSetSensorNum();
    case DISCONNECTION_FROM_ACTIVE_NODE_TIME:
      return isSetDisconnectionFromActiveNodeTime();
    case AI_NODE_NUM:
      return isSetAiNodeNum();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_licenseIssueTimestamp = true;
    boolean that_present_licenseIssueTimestamp = true;
    if (this_present_licenseIssueTimestamp || that_present_licenseIssueTimestamp) {
      if (!(this_present_licenseIssueTimestamp && that_present_licenseIssueTimestamp))
        return false;
      if (this.licenseIssueTimestamp != that.licenseIssueTimestamp)
        return false;
    }

    boolean this_present_expireTimestamp = true;
    boolean that_present_expireTimestamp = true;
    if (this_present_expireTimestamp || that_present_expireTimestamp) {
      if (!(this_present_expireTimestamp && that_present_expireTimestamp))
        return false;
      if (this.expireTimestamp != that.expireTimestamp)
        return false;
    }

    boolean this_present_dataNodeNum = true;
    boolean that_present_dataNodeNum = true;
    if (this_present_dataNodeNum || that_present_dataNodeNum) {
      if (!(this_present_dataNodeNum && that_present_dataNodeNum))
        return false;
      if (this.dataNodeNum != that.dataNodeNum)
        return false;
    }

    boolean this_present_cpuCoreNum = true;
    boolean that_present_cpuCoreNum = true;
    if (this_present_cpuCoreNum || that_present_cpuCoreNum) {
      if (!(this_present_cpuCoreNum && that_present_cpuCoreNum))
        return false;
      if (this.cpuCoreNum != that.cpuCoreNum)
        return false;
    }

    boolean this_present_deviceNum = true;
    boolean that_present_deviceNum = true;
    if (this_present_deviceNum || that_present_deviceNum) {
      if (!(this_present_deviceNum && that_present_deviceNum))
        return false;
      if (this.deviceNum != that.deviceNum)
        return false;
    }

    boolean this_present_sensorNum = true;
    boolean that_present_sensorNum = true;
    if (this_present_sensorNum || that_present_sensorNum) {
      if (!(this_present_sensorNum && that_present_sensorNum))
        return false;
      if (this.sensorNum != that.sensorNum)
        return false;
    }

    boolean this_present_disconnectionFromActiveNodeTime = true;
    boolean that_present_disconnectionFromActiveNodeTime = true;
    if (this_present_disconnectionFromActiveNodeTime || that_present_disconnectionFromActiveNodeTime) {
      if (!(this_present_disconnectionFromActiveNodeTime && that_present_disconnectionFromActiveNodeTime))
        return false;
      if (this.disconnectionFromActiveNodeTime != that.disconnectionFromActiveNodeTime)
        return false;
    }

    boolean this_present_aiNodeNum = true;
    boolean that_present_aiNodeNum = true;
    if (this_present_aiNodeNum || that_present_aiNodeNum) {
      if (!(this_present_aiNodeNum && that_present_aiNodeNum))
        return false;
      if (this.aiNodeNum != that.aiNodeNum)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(licenseIssueTimestamp);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(expireTimestamp);

    hashCode = hashCode * 8191 + dataNodeNum;

    hashCode = hashCode * 8191 + cpuCoreNum;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(deviceNum);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(sensorNum);

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(disconnectionFromActiveNodeTime);

    hashCode = hashCode * 8191 + aiNodeNum;

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetLicenseIssueTimestamp(), other.isSetLicenseIssueTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLicenseIssueTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.licenseIssueTimestamp, other.licenseIssueTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetExpireTimestamp(), other.isSetExpireTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExpireTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expireTimestamp, other.expireTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDataNodeNum(), other.isSetDataNodeNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataNodeNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataNodeNum, other.dataNodeNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCpuCoreNum(), other.isSetCpuCoreNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCpuCoreNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpuCoreNum, other.cpuCoreNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDeviceNum(), other.isSetDeviceNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeviceNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deviceNum, other.deviceNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSensorNum(), other.isSetSensorNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSensorNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sensorNum, other.sensorNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDisconnectionFromActiveNodeTime(), other.isSetDisconnectionFromActiveNodeTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisconnectionFromActiveNodeTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disconnectionFromActiveNodeTime, other.disconnectionFromActiveNodeTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetAiNodeNum(), other.isSetAiNodeNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAiNodeNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aiNodeNum, other.aiNodeNum);
      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("TLicense(");
    boolean first = true;

    sb.append("licenseIssueTimestamp:");
    sb.append(this.licenseIssueTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("expireTimestamp:");
    sb.append(this.expireTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dataNodeNum:");
    sb.append(this.dataNodeNum);
    first = false;
    if (!first) sb.append(", ");
    sb.append("cpuCoreNum:");
    sb.append(this.cpuCoreNum);
    first = false;
    if (!first) sb.append(", ");
    sb.append("deviceNum:");
    sb.append(this.deviceNum);
    first = false;
    if (!first) sb.append(", ");
    sb.append("sensorNum:");
    sb.append(this.sensorNum);
    first = false;
    if (!first) sb.append(", ");
    sb.append("disconnectionFromActiveNodeTime:");
    sb.append(this.disconnectionFromActiveNodeTime);
    first = false;
    if (!first) sb.append(", ");
    sb.append("aiNodeNum:");
    sb.append(this.aiNodeNum);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'licenseIssueTimestamp' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'expireTimestamp' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'dataNodeNum' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'cpuCoreNum' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'deviceNum' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'sensorNum' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'disconnectionFromActiveNodeTime' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'aiNodeNum' because it's a primitive and you chose the non-beans generator.
    // 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 TLicenseStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TLicenseStandardScheme getScheme() {
      return new TLicenseStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, TLicense 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: // LICENSE_ISSUE_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.licenseIssueTimestamp = iprot.readI64();
              struct.setLicenseIssueTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // EXPIRE_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.expireTimestamp = iprot.readI64();
              struct.setExpireTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DATA_NODE_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.dataNodeNum = iprot.readI16();
              struct.setDataNodeNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CPU_CORE_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.cpuCoreNum = iprot.readI32();
              struct.setCpuCoreNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // DEVICE_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.deviceNum = iprot.readI64();
              struct.setDeviceNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SENSOR_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.sensorNum = iprot.readI64();
              struct.setSensorNumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // DISCONNECTION_FROM_ACTIVE_NODE_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.disconnectionFromActiveNodeTime = iprot.readI64();
              struct.setDisconnectionFromActiveNodeTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // AI_NODE_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.aiNodeNum = iprot.readI16();
              struct.setAiNodeNumIsSet(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
      if (!struct.isSetLicenseIssueTimestamp()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'licenseIssueTimestamp' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetExpireTimestamp()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'expireTimestamp' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetDataNodeNum()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataNodeNum' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetCpuCoreNum()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'cpuCoreNum' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetDeviceNum()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'deviceNum' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetSensorNum()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sensorNum' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetDisconnectionFromActiveNodeTime()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'disconnectionFromActiveNodeTime' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetAiNodeNum()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'aiNodeNum' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(LICENSE_ISSUE_TIMESTAMP_FIELD_DESC);
      oprot.writeI64(struct.licenseIssueTimestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(EXPIRE_TIMESTAMP_FIELD_DESC);
      oprot.writeI64(struct.expireTimestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DATA_NODE_NUM_FIELD_DESC);
      oprot.writeI16(struct.dataNodeNum);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CPU_CORE_NUM_FIELD_DESC);
      oprot.writeI32(struct.cpuCoreNum);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DEVICE_NUM_FIELD_DESC);
      oprot.writeI64(struct.deviceNum);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SENSOR_NUM_FIELD_DESC);
      oprot.writeI64(struct.sensorNum);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DISCONNECTION_FROM_ACTIVE_NODE_TIME_FIELD_DESC);
      oprot.writeI64(struct.disconnectionFromActiveNodeTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AI_NODE_NUM_FIELD_DESC);
      oprot.writeI16(struct.aiNodeNum);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TLicense struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.licenseIssueTimestamp);
      oprot.writeI64(struct.expireTimestamp);
      oprot.writeI16(struct.dataNodeNum);
      oprot.writeI32(struct.cpuCoreNum);
      oprot.writeI64(struct.deviceNum);
      oprot.writeI64(struct.sensorNum);
      oprot.writeI64(struct.disconnectionFromActiveNodeTime);
      oprot.writeI16(struct.aiNodeNum);
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TLicense struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.licenseIssueTimestamp = iprot.readI64();
      struct.setLicenseIssueTimestampIsSet(true);
      struct.expireTimestamp = iprot.readI64();
      struct.setExpireTimestampIsSet(true);
      struct.dataNodeNum = iprot.readI16();
      struct.setDataNodeNumIsSet(true);
      struct.cpuCoreNum = iprot.readI32();
      struct.setCpuCoreNumIsSet(true);
      struct.deviceNum = iprot.readI64();
      struct.setDeviceNumIsSet(true);
      struct.sensorNum = iprot.readI64();
      struct.setSensorNumIsSet(true);
      struct.disconnectionFromActiveNodeTime = iprot.readI64();
      struct.setDisconnectionFromActiveNodeTimeIsSet(true);
      struct.aiNodeNum = iprot.readI16();
      struct.setAiNodeNumIsSet(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