/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.navercorp.pinpoint.thrift.dto;

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

  private static final org.apache.thrift.protocol.TField AGENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("agentId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField START_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("startTimestamp", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3);
  private static final org.apache.thrift.protocol.TField COLLECT_INTERVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("collectInterval", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField GC_FIELD_DESC = new org.apache.thrift.protocol.TField("gc", org.apache.thrift.protocol.TType.STRUCT, (short)10);
  private static final org.apache.thrift.protocol.TField CPU_LOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("cpuLoad", org.apache.thrift.protocol.TType.STRUCT, (short)20);
  private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)30);
  private static final org.apache.thrift.protocol.TField ACTIVE_TRACE_FIELD_DESC = new org.apache.thrift.protocol.TField("activeTrace", org.apache.thrift.protocol.TType.STRUCT, (short)40);
  private static final org.apache.thrift.protocol.TField DATA_SOURCE_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("dataSourceList", org.apache.thrift.protocol.TType.STRUCT, (short)50);
  private static final org.apache.thrift.protocol.TField RESPONSE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("responseTime", org.apache.thrift.protocol.TType.STRUCT, (short)60);
  private static final org.apache.thrift.protocol.TField DEADLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("deadlock", org.apache.thrift.protocol.TType.STRUCT, (short)70);
  private static final org.apache.thrift.protocol.TField FILE_DESCRIPTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("fileDescriptor", org.apache.thrift.protocol.TType.STRUCT, (short)80);
  private static final org.apache.thrift.protocol.TField DIRECT_BUFFER_FIELD_DESC = new org.apache.thrift.protocol.TField("directBuffer", org.apache.thrift.protocol.TType.STRUCT, (short)90);
  private static final org.apache.thrift.protocol.TField TOTAL_THREAD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalThreadCount", org.apache.thrift.protocol.TType.STRUCT, (short)100);
  private static final org.apache.thrift.protocol.TField LOADED_CLASS_FIELD_DESC = new org.apache.thrift.protocol.TField("loadedClass", org.apache.thrift.protocol.TType.STRUCT, (short)110);
  private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)200);

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

  private @org.apache.thrift.annotation.Nullable java.lang.String agentId; // optional
  private long startTimestamp; // optional
  private long timestamp; // optional
  private long collectInterval; // optional
  private @org.apache.thrift.annotation.Nullable TJvmGc gc; // optional
  private @org.apache.thrift.annotation.Nullable TCpuLoad cpuLoad; // optional
  private @org.apache.thrift.annotation.Nullable TTransaction transaction; // optional
  private @org.apache.thrift.annotation.Nullable TActiveTrace activeTrace; // optional
  private @org.apache.thrift.annotation.Nullable TDataSourceList dataSourceList; // optional
  private @org.apache.thrift.annotation.Nullable TResponseTime responseTime; // optional
  private @org.apache.thrift.annotation.Nullable TDeadlock deadlock; // optional
  private @org.apache.thrift.annotation.Nullable TFileDescriptor fileDescriptor; // optional
  private @org.apache.thrift.annotation.Nullable TDirectBuffer directBuffer; // optional
  private @org.apache.thrift.annotation.Nullable TTotalThreadCount totalThreadCount; // optional
  private @org.apache.thrift.annotation.Nullable TLoadedClass loadedClass; // optional
  private @org.apache.thrift.annotation.Nullable java.lang.String metadata; // 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 {
    AGENT_ID((short)1, "agentId"),
    START_TIMESTAMP((short)2, "startTimestamp"),
    TIMESTAMP((short)3, "timestamp"),
    COLLECT_INTERVAL((short)4, "collectInterval"),
    GC((short)10, "gc"),
    CPU_LOAD((short)20, "cpuLoad"),
    TRANSACTION((short)30, "transaction"),
    ACTIVE_TRACE((short)40, "activeTrace"),
    DATA_SOURCE_LIST((short)50, "dataSourceList"),
    RESPONSE_TIME((short)60, "responseTime"),
    DEADLOCK((short)70, "deadlock"),
    FILE_DESCRIPTOR((short)80, "fileDescriptor"),
    DIRECT_BUFFER((short)90, "directBuffer"),
    TOTAL_THREAD_COUNT((short)100, "totalThreadCount"),
    LOADED_CLASS((short)110, "loadedClass"),
    METADATA((short)200, "metadata");

    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: // AGENT_ID
          return AGENT_ID;
        case 2: // START_TIMESTAMP
          return START_TIMESTAMP;
        case 3: // TIMESTAMP
          return TIMESTAMP;
        case 4: // COLLECT_INTERVAL
          return COLLECT_INTERVAL;
        case 10: // GC
          return GC;
        case 20: // CPU_LOAD
          return CPU_LOAD;
        case 30: // TRANSACTION
          return TRANSACTION;
        case 40: // ACTIVE_TRACE
          return ACTIVE_TRACE;
        case 50: // DATA_SOURCE_LIST
          return DATA_SOURCE_LIST;
        case 60: // RESPONSE_TIME
          return RESPONSE_TIME;
        case 70: // DEADLOCK
          return DEADLOCK;
        case 80: // FILE_DESCRIPTOR
          return FILE_DESCRIPTOR;
        case 90: // DIRECT_BUFFER
          return DIRECT_BUFFER;
        case 100: // TOTAL_THREAD_COUNT
          return TOTAL_THREAD_COUNT;
        case 110: // LOADED_CLASS
          return LOADED_CLASS;
        case 200: // METADATA
          return METADATA;
        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 __STARTTIMESTAMP_ISSET_ID = 0;
  private static final int __TIMESTAMP_ISSET_ID = 1;
  private static final int __COLLECTINTERVAL_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.AGENT_ID,_Fields.START_TIMESTAMP,_Fields.TIMESTAMP,_Fields.COLLECT_INTERVAL,_Fields.GC,_Fields.CPU_LOAD,_Fields.TRANSACTION,_Fields.ACTIVE_TRACE,_Fields.DATA_SOURCE_LIST,_Fields.RESPONSE_TIME,_Fields.DEADLOCK,_Fields.FILE_DESCRIPTOR,_Fields.DIRECT_BUFFER,_Fields.TOTAL_THREAD_COUNT,_Fields.LOADED_CLASS,_Fields.METADATA};
  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.AGENT_ID, new org.apache.thrift.meta_data.FieldMetaData("agentId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.START_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("startTimestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COLLECT_INTERVAL, new org.apache.thrift.meta_data.FieldMetaData("collectInterval", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.GC, new org.apache.thrift.meta_data.FieldMetaData("gc", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TJvmGc.class)));
    tmpMap.put(_Fields.CPU_LOAD, new org.apache.thrift.meta_data.FieldMetaData("cpuLoad", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCpuLoad.class)));
    tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTransaction.class)));
    tmpMap.put(_Fields.ACTIVE_TRACE, new org.apache.thrift.meta_data.FieldMetaData("activeTrace", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TActiveTrace.class)));
    tmpMap.put(_Fields.DATA_SOURCE_LIST, new org.apache.thrift.meta_data.FieldMetaData("dataSourceList", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "TDataSourceList")));
    tmpMap.put(_Fields.RESPONSE_TIME, new org.apache.thrift.meta_data.FieldMetaData("responseTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TResponseTime.class)));
    tmpMap.put(_Fields.DEADLOCK, new org.apache.thrift.meta_data.FieldMetaData("deadlock", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDeadlock.class)));
    tmpMap.put(_Fields.FILE_DESCRIPTOR, new org.apache.thrift.meta_data.FieldMetaData("fileDescriptor", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "TFileDescriptor")));
    tmpMap.put(_Fields.DIRECT_BUFFER, new org.apache.thrift.meta_data.FieldMetaData("directBuffer", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDirectBuffer.class)));
    tmpMap.put(_Fields.TOTAL_THREAD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("totalThreadCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "TTotalThreadCount")));
    tmpMap.put(_Fields.LOADED_CLASS, new org.apache.thrift.meta_data.FieldMetaData("loadedClass", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "TLoadedClass")));
    tmpMap.put(_Fields.METADATA, new org.apache.thrift.meta_data.FieldMetaData("metadata", 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(TAgentStat.class, metaDataMap);
  }

  public TAgentStat() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TAgentStat(TAgentStat other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetAgentId()) {
      this.agentId = other.agentId;
    }
    this.startTimestamp = other.startTimestamp;
    this.timestamp = other.timestamp;
    this.collectInterval = other.collectInterval;
    if (other.isSetGc()) {
      this.gc = new TJvmGc(other.gc);
    }
    if (other.isSetCpuLoad()) {
      this.cpuLoad = new TCpuLoad(other.cpuLoad);
    }
    if (other.isSetTransaction()) {
      this.transaction = new TTransaction(other.transaction);
    }
    if (other.isSetActiveTrace()) {
      this.activeTrace = new TActiveTrace(other.activeTrace);
    }
    if (other.isSetDataSourceList()) {
      this.dataSourceList = new TDataSourceList(other.dataSourceList);
    }
    if (other.isSetResponseTime()) {
      this.responseTime = new TResponseTime(other.responseTime);
    }
    if (other.isSetDeadlock()) {
      this.deadlock = new TDeadlock(other.deadlock);
    }
    if (other.isSetFileDescriptor()) {
      this.fileDescriptor = new TFileDescriptor(other.fileDescriptor);
    }
    if (other.isSetDirectBuffer()) {
      this.directBuffer = new TDirectBuffer(other.directBuffer);
    }
    if (other.isSetTotalThreadCount()) {
      this.totalThreadCount = new TTotalThreadCount(other.totalThreadCount);
    }
    if (other.isSetLoadedClass()) {
      this.loadedClass = new TLoadedClass(other.loadedClass);
    }
    if (other.isSetMetadata()) {
      this.metadata = other.metadata;
    }
  }

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

  @Override
  public void clear() {
    this.agentId = null;
    setStartTimestampIsSet(false);
    this.startTimestamp = 0;
    setTimestampIsSet(false);
    this.timestamp = 0;
    setCollectIntervalIsSet(false);
    this.collectInterval = 0;
    this.gc = null;
    this.cpuLoad = null;
    this.transaction = null;
    this.activeTrace = null;
    this.dataSourceList = null;
    this.responseTime = null;
    this.deadlock = null;
    this.fileDescriptor = null;
    this.directBuffer = null;
    this.totalThreadCount = null;
    this.loadedClass = null;
    this.metadata = null;
  }

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

  public void setAgentId(@org.apache.thrift.annotation.Nullable java.lang.String agentId) {
    this.agentId = agentId;
  }

  public void unsetAgentId() {
    this.agentId = null;
  }

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

  public void setAgentIdIsSet(boolean value) {
    if (!value) {
      this.agentId = null;
    }
  }

  public long getStartTimestamp() {
    return this.startTimestamp;
  }

  public void setStartTimestamp(long startTimestamp) {
    this.startTimestamp = startTimestamp;
    setStartTimestampIsSet(true);
  }

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

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

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

  public long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(long timestamp) {
    this.timestamp = timestamp;
    setTimestampIsSet(true);
  }

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

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

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

  public long getCollectInterval() {
    return this.collectInterval;
  }

  public void setCollectInterval(long collectInterval) {
    this.collectInterval = collectInterval;
    setCollectIntervalIsSet(true);
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public TJvmGc getGc() {
    return this.gc;
  }

  public void setGc(@org.apache.thrift.annotation.Nullable TJvmGc gc) {
    this.gc = gc;
  }

  public void unsetGc() {
    this.gc = null;
  }

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

  public void setGcIsSet(boolean value) {
    if (!value) {
      this.gc = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TCpuLoad getCpuLoad() {
    return this.cpuLoad;
  }

  public void setCpuLoad(@org.apache.thrift.annotation.Nullable TCpuLoad cpuLoad) {
    this.cpuLoad = cpuLoad;
  }

  public void unsetCpuLoad() {
    this.cpuLoad = null;
  }

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

  public void setCpuLoadIsSet(boolean value) {
    if (!value) {
      this.cpuLoad = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TTransaction getTransaction() {
    return this.transaction;
  }

  public void setTransaction(@org.apache.thrift.annotation.Nullable TTransaction transaction) {
    this.transaction = transaction;
  }

  public void unsetTransaction() {
    this.transaction = null;
  }

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

  public void setTransactionIsSet(boolean value) {
    if (!value) {
      this.transaction = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TActiveTrace getActiveTrace() {
    return this.activeTrace;
  }

  public void setActiveTrace(@org.apache.thrift.annotation.Nullable TActiveTrace activeTrace) {
    this.activeTrace = activeTrace;
  }

  public void unsetActiveTrace() {
    this.activeTrace = null;
  }

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

  public void setActiveTraceIsSet(boolean value) {
    if (!value) {
      this.activeTrace = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TDataSourceList getDataSourceList() {
    return this.dataSourceList;
  }

  public void setDataSourceList(@org.apache.thrift.annotation.Nullable TDataSourceList dataSourceList) {
    this.dataSourceList = dataSourceList;
  }

  public void unsetDataSourceList() {
    this.dataSourceList = null;
  }

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

  public void setDataSourceListIsSet(boolean value) {
    if (!value) {
      this.dataSourceList = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TResponseTime getResponseTime() {
    return this.responseTime;
  }

  public void setResponseTime(@org.apache.thrift.annotation.Nullable TResponseTime responseTime) {
    this.responseTime = responseTime;
  }

  public void unsetResponseTime() {
    this.responseTime = null;
  }

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

  public void setResponseTimeIsSet(boolean value) {
    if (!value) {
      this.responseTime = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TDeadlock getDeadlock() {
    return this.deadlock;
  }

  public void setDeadlock(@org.apache.thrift.annotation.Nullable TDeadlock deadlock) {
    this.deadlock = deadlock;
  }

  public void unsetDeadlock() {
    this.deadlock = null;
  }

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

  public void setDeadlockIsSet(boolean value) {
    if (!value) {
      this.deadlock = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TFileDescriptor getFileDescriptor() {
    return this.fileDescriptor;
  }

  public void setFileDescriptor(@org.apache.thrift.annotation.Nullable TFileDescriptor fileDescriptor) {
    this.fileDescriptor = fileDescriptor;
  }

  public void unsetFileDescriptor() {
    this.fileDescriptor = null;
  }

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

  public void setFileDescriptorIsSet(boolean value) {
    if (!value) {
      this.fileDescriptor = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TDirectBuffer getDirectBuffer() {
    return this.directBuffer;
  }

  public void setDirectBuffer(@org.apache.thrift.annotation.Nullable TDirectBuffer directBuffer) {
    this.directBuffer = directBuffer;
  }

  public void unsetDirectBuffer() {
    this.directBuffer = null;
  }

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

  public void setDirectBufferIsSet(boolean value) {
    if (!value) {
      this.directBuffer = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TTotalThreadCount getTotalThreadCount() {
    return this.totalThreadCount;
  }

  public void setTotalThreadCount(@org.apache.thrift.annotation.Nullable TTotalThreadCount totalThreadCount) {
    this.totalThreadCount = totalThreadCount;
  }

  public void unsetTotalThreadCount() {
    this.totalThreadCount = null;
  }

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

  public void setTotalThreadCountIsSet(boolean value) {
    if (!value) {
      this.totalThreadCount = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TLoadedClass getLoadedClass() {
    return this.loadedClass;
  }

  public void setLoadedClass(@org.apache.thrift.annotation.Nullable TLoadedClass loadedClass) {
    this.loadedClass = loadedClass;
  }

  public void unsetLoadedClass() {
    this.loadedClass = null;
  }

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

  public void setLoadedClassIsSet(boolean value) {
    if (!value) {
      this.loadedClass = null;
    }
  }

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

  public void setMetadata(@org.apache.thrift.annotation.Nullable java.lang.String metadata) {
    this.metadata = metadata;
  }

  public void unsetMetadata() {
    this.metadata = null;
  }

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

  public void setMetadataIsSet(boolean value) {
    if (!value) {
      this.metadata = null;
    }
  }

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

    case START_TIMESTAMP:
      if (value == null) {
        unsetStartTimestamp();
      } else {
        setStartTimestamp((java.lang.Long)value);
      }
      break;

    case TIMESTAMP:
      if (value == null) {
        unsetTimestamp();
      } else {
        setTimestamp((java.lang.Long)value);
      }
      break;

    case COLLECT_INTERVAL:
      if (value == null) {
        unsetCollectInterval();
      } else {
        setCollectInterval((java.lang.Long)value);
      }
      break;

    case GC:
      if (value == null) {
        unsetGc();
      } else {
        setGc((TJvmGc)value);
      }
      break;

    case CPU_LOAD:
      if (value == null) {
        unsetCpuLoad();
      } else {
        setCpuLoad((TCpuLoad)value);
      }
      break;

    case TRANSACTION:
      if (value == null) {
        unsetTransaction();
      } else {
        setTransaction((TTransaction)value);
      }
      break;

    case ACTIVE_TRACE:
      if (value == null) {
        unsetActiveTrace();
      } else {
        setActiveTrace((TActiveTrace)value);
      }
      break;

    case DATA_SOURCE_LIST:
      if (value == null) {
        unsetDataSourceList();
      } else {
        setDataSourceList((TDataSourceList)value);
      }
      break;

    case RESPONSE_TIME:
      if (value == null) {
        unsetResponseTime();
      } else {
        setResponseTime((TResponseTime)value);
      }
      break;

    case DEADLOCK:
      if (value == null) {
        unsetDeadlock();
      } else {
        setDeadlock((TDeadlock)value);
      }
      break;

    case FILE_DESCRIPTOR:
      if (value == null) {
        unsetFileDescriptor();
      } else {
        setFileDescriptor((TFileDescriptor)value);
      }
      break;

    case DIRECT_BUFFER:
      if (value == null) {
        unsetDirectBuffer();
      } else {
        setDirectBuffer((TDirectBuffer)value);
      }
      break;

    case TOTAL_THREAD_COUNT:
      if (value == null) {
        unsetTotalThreadCount();
      } else {
        setTotalThreadCount((TTotalThreadCount)value);
      }
      break;

    case LOADED_CLASS:
      if (value == null) {
        unsetLoadedClass();
      } else {
        setLoadedClass((TLoadedClass)value);
      }
      break;

    case METADATA:
      if (value == null) {
        unsetMetadata();
      } else {
        setMetadata((java.lang.String)value);
      }
      break;

    }
  }

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

    case START_TIMESTAMP:
      return getStartTimestamp();

    case TIMESTAMP:
      return getTimestamp();

    case COLLECT_INTERVAL:
      return getCollectInterval();

    case GC:
      return getGc();

    case CPU_LOAD:
      return getCpuLoad();

    case TRANSACTION:
      return getTransaction();

    case ACTIVE_TRACE:
      return getActiveTrace();

    case DATA_SOURCE_LIST:
      return getDataSourceList();

    case RESPONSE_TIME:
      return getResponseTime();

    case DEADLOCK:
      return getDeadlock();

    case FILE_DESCRIPTOR:
      return getFileDescriptor();

    case DIRECT_BUFFER:
      return getDirectBuffer();

    case TOTAL_THREAD_COUNT:
      return getTotalThreadCount();

    case LOADED_CLASS:
      return getLoadedClass();

    case METADATA:
      return getMetadata();

    }
    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 AGENT_ID:
      return isSetAgentId();
    case START_TIMESTAMP:
      return isSetStartTimestamp();
    case TIMESTAMP:
      return isSetTimestamp();
    case COLLECT_INTERVAL:
      return isSetCollectInterval();
    case GC:
      return isSetGc();
    case CPU_LOAD:
      return isSetCpuLoad();
    case TRANSACTION:
      return isSetTransaction();
    case ACTIVE_TRACE:
      return isSetActiveTrace();
    case DATA_SOURCE_LIST:
      return isSetDataSourceList();
    case RESPONSE_TIME:
      return isSetResponseTime();
    case DEADLOCK:
      return isSetDeadlock();
    case FILE_DESCRIPTOR:
      return isSetFileDescriptor();
    case DIRECT_BUFFER:
      return isSetDirectBuffer();
    case TOTAL_THREAD_COUNT:
      return isSetTotalThreadCount();
    case LOADED_CLASS:
      return isSetLoadedClass();
    case METADATA:
      return isSetMetadata();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_agentId = true && this.isSetAgentId();
    boolean that_present_agentId = true && that.isSetAgentId();
    if (this_present_agentId || that_present_agentId) {
      if (!(this_present_agentId && that_present_agentId))
        return false;
      if (!this.agentId.equals(that.agentId))
        return false;
    }

    boolean this_present_startTimestamp = true && this.isSetStartTimestamp();
    boolean that_present_startTimestamp = true && that.isSetStartTimestamp();
    if (this_present_startTimestamp || that_present_startTimestamp) {
      if (!(this_present_startTimestamp && that_present_startTimestamp))
        return false;
      if (this.startTimestamp != that.startTimestamp)
        return false;
    }

    boolean this_present_timestamp = true && this.isSetTimestamp();
    boolean that_present_timestamp = true && that.isSetTimestamp();
    if (this_present_timestamp || that_present_timestamp) {
      if (!(this_present_timestamp && that_present_timestamp))
        return false;
      if (this.timestamp != that.timestamp)
        return false;
    }

    boolean this_present_collectInterval = true && this.isSetCollectInterval();
    boolean that_present_collectInterval = true && that.isSetCollectInterval();
    if (this_present_collectInterval || that_present_collectInterval) {
      if (!(this_present_collectInterval && that_present_collectInterval))
        return false;
      if (this.collectInterval != that.collectInterval)
        return false;
    }

    boolean this_present_gc = true && this.isSetGc();
    boolean that_present_gc = true && that.isSetGc();
    if (this_present_gc || that_present_gc) {
      if (!(this_present_gc && that_present_gc))
        return false;
      if (!this.gc.equals(that.gc))
        return false;
    }

    boolean this_present_cpuLoad = true && this.isSetCpuLoad();
    boolean that_present_cpuLoad = true && that.isSetCpuLoad();
    if (this_present_cpuLoad || that_present_cpuLoad) {
      if (!(this_present_cpuLoad && that_present_cpuLoad))
        return false;
      if (!this.cpuLoad.equals(that.cpuLoad))
        return false;
    }

    boolean this_present_transaction = true && this.isSetTransaction();
    boolean that_present_transaction = true && that.isSetTransaction();
    if (this_present_transaction || that_present_transaction) {
      if (!(this_present_transaction && that_present_transaction))
        return false;
      if (!this.transaction.equals(that.transaction))
        return false;
    }

    boolean this_present_activeTrace = true && this.isSetActiveTrace();
    boolean that_present_activeTrace = true && that.isSetActiveTrace();
    if (this_present_activeTrace || that_present_activeTrace) {
      if (!(this_present_activeTrace && that_present_activeTrace))
        return false;
      if (!this.activeTrace.equals(that.activeTrace))
        return false;
    }

    boolean this_present_dataSourceList = true && this.isSetDataSourceList();
    boolean that_present_dataSourceList = true && that.isSetDataSourceList();
    if (this_present_dataSourceList || that_present_dataSourceList) {
      if (!(this_present_dataSourceList && that_present_dataSourceList))
        return false;
      if (!this.dataSourceList.equals(that.dataSourceList))
        return false;
    }

    boolean this_present_responseTime = true && this.isSetResponseTime();
    boolean that_present_responseTime = true && that.isSetResponseTime();
    if (this_present_responseTime || that_present_responseTime) {
      if (!(this_present_responseTime && that_present_responseTime))
        return false;
      if (!this.responseTime.equals(that.responseTime))
        return false;
    }

    boolean this_present_deadlock = true && this.isSetDeadlock();
    boolean that_present_deadlock = true && that.isSetDeadlock();
    if (this_present_deadlock || that_present_deadlock) {
      if (!(this_present_deadlock && that_present_deadlock))
        return false;
      if (!this.deadlock.equals(that.deadlock))
        return false;
    }

    boolean this_present_fileDescriptor = true && this.isSetFileDescriptor();
    boolean that_present_fileDescriptor = true && that.isSetFileDescriptor();
    if (this_present_fileDescriptor || that_present_fileDescriptor) {
      if (!(this_present_fileDescriptor && that_present_fileDescriptor))
        return false;
      if (!this.fileDescriptor.equals(that.fileDescriptor))
        return false;
    }

    boolean this_present_directBuffer = true && this.isSetDirectBuffer();
    boolean that_present_directBuffer = true && that.isSetDirectBuffer();
    if (this_present_directBuffer || that_present_directBuffer) {
      if (!(this_present_directBuffer && that_present_directBuffer))
        return false;
      if (!this.directBuffer.equals(that.directBuffer))
        return false;
    }

    boolean this_present_totalThreadCount = true && this.isSetTotalThreadCount();
    boolean that_present_totalThreadCount = true && that.isSetTotalThreadCount();
    if (this_present_totalThreadCount || that_present_totalThreadCount) {
      if (!(this_present_totalThreadCount && that_present_totalThreadCount))
        return false;
      if (!this.totalThreadCount.equals(that.totalThreadCount))
        return false;
    }

    boolean this_present_loadedClass = true && this.isSetLoadedClass();
    boolean that_present_loadedClass = true && that.isSetLoadedClass();
    if (this_present_loadedClass || that_present_loadedClass) {
      if (!(this_present_loadedClass && that_present_loadedClass))
        return false;
      if (!this.loadedClass.equals(that.loadedClass))
        return false;
    }

    boolean this_present_metadata = true && this.isSetMetadata();
    boolean that_present_metadata = true && that.isSetMetadata();
    if (this_present_metadata || that_present_metadata) {
      if (!(this_present_metadata && that_present_metadata))
        return false;
      if (!this.metadata.equals(that.metadata))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetAgentId()) ? 131071 : 524287);
    if (isSetAgentId())
      hashCode = hashCode * 8191 + agentId.hashCode();

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

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

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

    hashCode = hashCode * 8191 + ((isSetGc()) ? 131071 : 524287);
    if (isSetGc())
      hashCode = hashCode * 8191 + gc.hashCode();

    hashCode = hashCode * 8191 + ((isSetCpuLoad()) ? 131071 : 524287);
    if (isSetCpuLoad())
      hashCode = hashCode * 8191 + cpuLoad.hashCode();

    hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287);
    if (isSetTransaction())
      hashCode = hashCode * 8191 + transaction.hashCode();

    hashCode = hashCode * 8191 + ((isSetActiveTrace()) ? 131071 : 524287);
    if (isSetActiveTrace())
      hashCode = hashCode * 8191 + activeTrace.hashCode();

    hashCode = hashCode * 8191 + ((isSetDataSourceList()) ? 131071 : 524287);
    if (isSetDataSourceList())
      hashCode = hashCode * 8191 + dataSourceList.hashCode();

    hashCode = hashCode * 8191 + ((isSetResponseTime()) ? 131071 : 524287);
    if (isSetResponseTime())
      hashCode = hashCode * 8191 + responseTime.hashCode();

    hashCode = hashCode * 8191 + ((isSetDeadlock()) ? 131071 : 524287);
    if (isSetDeadlock())
      hashCode = hashCode * 8191 + deadlock.hashCode();

    hashCode = hashCode * 8191 + ((isSetFileDescriptor()) ? 131071 : 524287);
    if (isSetFileDescriptor())
      hashCode = hashCode * 8191 + fileDescriptor.hashCode();

    hashCode = hashCode * 8191 + ((isSetDirectBuffer()) ? 131071 : 524287);
    if (isSetDirectBuffer())
      hashCode = hashCode * 8191 + directBuffer.hashCode();

    hashCode = hashCode * 8191 + ((isSetTotalThreadCount()) ? 131071 : 524287);
    if (isSetTotalThreadCount())
      hashCode = hashCode * 8191 + totalThreadCount.hashCode();

    hashCode = hashCode * 8191 + ((isSetLoadedClass()) ? 131071 : 524287);
    if (isSetLoadedClass())
      hashCode = hashCode * 8191 + loadedClass.hashCode();

    hashCode = hashCode * 8191 + ((isSetMetadata()) ? 131071 : 524287);
    if (isSetMetadata())
      hashCode = hashCode * 8191 + metadata.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetAgentId()).compareTo(other.isSetAgentId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAgentId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.agentId, other.agentId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetStartTimestamp()).compareTo(other.isSetStartTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTimestamp, other.startTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCollectInterval()).compareTo(other.isSetCollectInterval());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCollectInterval()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.collectInterval, other.collectInterval);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetGc()).compareTo(other.isSetGc());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGc()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gc, other.gc);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCpuLoad()).compareTo(other.isSetCpuLoad());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCpuLoad()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cpuLoad, other.cpuLoad);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTransaction()).compareTo(other.isSetTransaction());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransaction()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetActiveTrace()).compareTo(other.isSetActiveTrace());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActiveTrace()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.activeTrace, other.activeTrace);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDataSourceList()).compareTo(other.isSetDataSourceList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataSourceList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataSourceList, other.dataSourceList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetResponseTime()).compareTo(other.isSetResponseTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResponseTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseTime, other.responseTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDeadlock()).compareTo(other.isSetDeadlock());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeadlock()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deadlock, other.deadlock);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetFileDescriptor()).compareTo(other.isSetFileDescriptor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileDescriptor()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileDescriptor, other.fileDescriptor);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDirectBuffer()).compareTo(other.isSetDirectBuffer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDirectBuffer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.directBuffer, other.directBuffer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTotalThreadCount()).compareTo(other.isSetTotalThreadCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalThreadCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalThreadCount, other.totalThreadCount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetLoadedClass()).compareTo(other.isSetLoadedClass());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoadedClass()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loadedClass, other.loadedClass);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetMetadata()).compareTo(other.isSetMetadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadata, other.metadata);
      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("TAgentStat(");
    boolean first = true;

    if (isSetAgentId()) {
      sb.append("agentId:");
      if (this.agentId == null) {
        sb.append("null");
      } else {
        sb.append(this.agentId);
      }
      first = false;
    }
    if (isSetStartTimestamp()) {
      if (!first) sb.append(", ");
      sb.append("startTimestamp:");
      sb.append(this.startTimestamp);
      first = false;
    }
    if (isSetTimestamp()) {
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
    }
    if (isSetCollectInterval()) {
      if (!first) sb.append(", ");
      sb.append("collectInterval:");
      sb.append(this.collectInterval);
      first = false;
    }
    if (isSetGc()) {
      if (!first) sb.append(", ");
      sb.append("gc:");
      if (this.gc == null) {
        sb.append("null");
      } else {
        sb.append(this.gc);
      }
      first = false;
    }
    if (isSetCpuLoad()) {
      if (!first) sb.append(", ");
      sb.append("cpuLoad:");
      if (this.cpuLoad == null) {
        sb.append("null");
      } else {
        sb.append(this.cpuLoad);
      }
      first = false;
    }
    if (isSetTransaction()) {
      if (!first) sb.append(", ");
      sb.append("transaction:");
      if (this.transaction == null) {
        sb.append("null");
      } else {
        sb.append(this.transaction);
      }
      first = false;
    }
    if (isSetActiveTrace()) {
      if (!first) sb.append(", ");
      sb.append("activeTrace:");
      if (this.activeTrace == null) {
        sb.append("null");
      } else {
        sb.append(this.activeTrace);
      }
      first = false;
    }
    if (isSetDataSourceList()) {
      if (!first) sb.append(", ");
      sb.append("dataSourceList:");
      if (this.dataSourceList == null) {
        sb.append("null");
      } else {
        sb.append(this.dataSourceList);
      }
      first = false;
    }
    if (isSetResponseTime()) {
      if (!first) sb.append(", ");
      sb.append("responseTime:");
      if (this.responseTime == null) {
        sb.append("null");
      } else {
        sb.append(this.responseTime);
      }
      first = false;
    }
    if (isSetDeadlock()) {
      if (!first) sb.append(", ");
      sb.append("deadlock:");
      if (this.deadlock == null) {
        sb.append("null");
      } else {
        sb.append(this.deadlock);
      }
      first = false;
    }
    if (isSetFileDescriptor()) {
      if (!first) sb.append(", ");
      sb.append("fileDescriptor:");
      if (this.fileDescriptor == null) {
        sb.append("null");
      } else {
        sb.append(this.fileDescriptor);
      }
      first = false;
    }
    if (isSetDirectBuffer()) {
      if (!first) sb.append(", ");
      sb.append("directBuffer:");
      if (this.directBuffer == null) {
        sb.append("null");
      } else {
        sb.append(this.directBuffer);
      }
      first = false;
    }
    if (isSetTotalThreadCount()) {
      if (!first) sb.append(", ");
      sb.append("totalThreadCount:");
      if (this.totalThreadCount == null) {
        sb.append("null");
      } else {
        sb.append(this.totalThreadCount);
      }
      first = false;
    }
    if (isSetLoadedClass()) {
      if (!first) sb.append(", ");
      sb.append("loadedClass:");
      if (this.loadedClass == null) {
        sb.append("null");
      } else {
        sb.append(this.loadedClass);
      }
      first = false;
    }
    if (isSetMetadata()) {
      if (!first) sb.append(", ");
      sb.append("metadata:");
      if (this.metadata == null) {
        sb.append("null");
      } else {
        sb.append(this.metadata);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (gc != null) {
      gc.validate();
    }
    if (cpuLoad != null) {
      cpuLoad.validate();
    }
    if (transaction != null) {
      transaction.validate();
    }
    if (activeTrace != null) {
      activeTrace.validate();
    }
    if (responseTime != null) {
      responseTime.validate();
    }
    if (deadlock != null) {
      deadlock.validate();
    }
    if (directBuffer != null) {
      directBuffer.validate();
    }
  }

  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 TAgentStatStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TAgentStatStandardScheme getScheme() {
      return new TAgentStatStandardScheme();
    }
  }

  private static class TAgentStatStandardScheme extends org.apache.thrift.scheme.StandardScheme<TAgentStat> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TAgentStat 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: // AGENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.agentId = iprot.readString();
              struct.setAgentIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // START_TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startTimestamp = iprot.readI64();
              struct.setStartTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COLLECT_INTERVAL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.collectInterval = iprot.readI64();
              struct.setCollectIntervalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // GC
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.gc = new TJvmGc();
              struct.gc.read(iprot);
              struct.setGcIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // CPU_LOAD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cpuLoad = new TCpuLoad();
              struct.cpuLoad.read(iprot);
              struct.setCpuLoadIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // TRANSACTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.transaction = new TTransaction();
              struct.transaction.read(iprot);
              struct.setTransactionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // ACTIVE_TRACE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.activeTrace = new TActiveTrace();
              struct.activeTrace.read(iprot);
              struct.setActiveTraceIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 50: // DATA_SOURCE_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.dataSourceList = new TDataSourceList();
              struct.dataSourceList.read(iprot);
              struct.setDataSourceListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 60: // RESPONSE_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.responseTime = new TResponseTime();
              struct.responseTime.read(iprot);
              struct.setResponseTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 70: // DEADLOCK
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.deadlock = new TDeadlock();
              struct.deadlock.read(iprot);
              struct.setDeadlockIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 80: // FILE_DESCRIPTOR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.fileDescriptor = new TFileDescriptor();
              struct.fileDescriptor.read(iprot);
              struct.setFileDescriptorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 90: // DIRECT_BUFFER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.directBuffer = new TDirectBuffer();
              struct.directBuffer.read(iprot);
              struct.setDirectBufferIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 100: // TOTAL_THREAD_COUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.totalThreadCount = new TTotalThreadCount();
              struct.totalThreadCount.read(iprot);
              struct.setTotalThreadCountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 110: // LOADED_CLASS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.loadedClass = new TLoadedClass();
              struct.loadedClass.read(iprot);
              struct.setLoadedClassIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 200: // METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.metadata = iprot.readString();
              struct.setMetadataIsSet(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();
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.agentId != null) {
        if (struct.isSetAgentId()) {
          oprot.writeFieldBegin(AGENT_ID_FIELD_DESC);
          oprot.writeString(struct.agentId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetStartTimestamp()) {
        oprot.writeFieldBegin(START_TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.startTimestamp);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTimestamp()) {
        oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
        oprot.writeI64(struct.timestamp);
        oprot.writeFieldEnd();
      }
      if (struct.isSetCollectInterval()) {
        oprot.writeFieldBegin(COLLECT_INTERVAL_FIELD_DESC);
        oprot.writeI64(struct.collectInterval);
        oprot.writeFieldEnd();
      }
      if (struct.gc != null) {
        if (struct.isSetGc()) {
          oprot.writeFieldBegin(GC_FIELD_DESC);
          struct.gc.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cpuLoad != null) {
        if (struct.isSetCpuLoad()) {
          oprot.writeFieldBegin(CPU_LOAD_FIELD_DESC);
          struct.cpuLoad.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.transaction != null) {
        if (struct.isSetTransaction()) {
          oprot.writeFieldBegin(TRANSACTION_FIELD_DESC);
          struct.transaction.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.activeTrace != null) {
        if (struct.isSetActiveTrace()) {
          oprot.writeFieldBegin(ACTIVE_TRACE_FIELD_DESC);
          struct.activeTrace.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.dataSourceList != null) {
        if (struct.isSetDataSourceList()) {
          oprot.writeFieldBegin(DATA_SOURCE_LIST_FIELD_DESC);
          struct.dataSourceList.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.responseTime != null) {
        if (struct.isSetResponseTime()) {
          oprot.writeFieldBegin(RESPONSE_TIME_FIELD_DESC);
          struct.responseTime.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.deadlock != null) {
        if (struct.isSetDeadlock()) {
          oprot.writeFieldBegin(DEADLOCK_FIELD_DESC);
          struct.deadlock.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.fileDescriptor != null) {
        if (struct.isSetFileDescriptor()) {
          oprot.writeFieldBegin(FILE_DESCRIPTOR_FIELD_DESC);
          struct.fileDescriptor.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.directBuffer != null) {
        if (struct.isSetDirectBuffer()) {
          oprot.writeFieldBegin(DIRECT_BUFFER_FIELD_DESC);
          struct.directBuffer.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.totalThreadCount != null) {
        if (struct.isSetTotalThreadCount()) {
          oprot.writeFieldBegin(TOTAL_THREAD_COUNT_FIELD_DESC);
          struct.totalThreadCount.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.loadedClass != null) {
        if (struct.isSetLoadedClass()) {
          oprot.writeFieldBegin(LOADED_CLASS_FIELD_DESC);
          struct.loadedClass.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.metadata != null) {
        if (struct.isSetMetadata()) {
          oprot.writeFieldBegin(METADATA_FIELD_DESC);
          oprot.writeString(struct.metadata);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TAgentStatTupleScheme extends org.apache.thrift.scheme.TupleScheme<TAgentStat> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TAgentStat 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.isSetAgentId()) {
        optionals.set(0);
      }
      if (struct.isSetStartTimestamp()) {
        optionals.set(1);
      }
      if (struct.isSetTimestamp()) {
        optionals.set(2);
      }
      if (struct.isSetCollectInterval()) {
        optionals.set(3);
      }
      if (struct.isSetGc()) {
        optionals.set(4);
      }
      if (struct.isSetCpuLoad()) {
        optionals.set(5);
      }
      if (struct.isSetTransaction()) {
        optionals.set(6);
      }
      if (struct.isSetActiveTrace()) {
        optionals.set(7);
      }
      if (struct.isSetDataSourceList()) {
        optionals.set(8);
      }
      if (struct.isSetResponseTime()) {
        optionals.set(9);
      }
      if (struct.isSetDeadlock()) {
        optionals.set(10);
      }
      if (struct.isSetFileDescriptor()) {
        optionals.set(11);
      }
      if (struct.isSetDirectBuffer()) {
        optionals.set(12);
      }
      if (struct.isSetTotalThreadCount()) {
        optionals.set(13);
      }
      if (struct.isSetLoadedClass()) {
        optionals.set(14);
      }
      if (struct.isSetMetadata()) {
        optionals.set(15);
      }
      oprot.writeBitSet(optionals, 16);
      if (struct.isSetAgentId()) {
        oprot.writeString(struct.agentId);
      }
      if (struct.isSetStartTimestamp()) {
        oprot.writeI64(struct.startTimestamp);
      }
      if (struct.isSetTimestamp()) {
        oprot.writeI64(struct.timestamp);
      }
      if (struct.isSetCollectInterval()) {
        oprot.writeI64(struct.collectInterval);
      }
      if (struct.isSetGc()) {
        struct.gc.write(oprot);
      }
      if (struct.isSetCpuLoad()) {
        struct.cpuLoad.write(oprot);
      }
      if (struct.isSetTransaction()) {
        struct.transaction.write(oprot);
      }
      if (struct.isSetActiveTrace()) {
        struct.activeTrace.write(oprot);
      }
      if (struct.isSetDataSourceList()) {
        struct.dataSourceList.write(oprot);
      }
      if (struct.isSetResponseTime()) {
        struct.responseTime.write(oprot);
      }
      if (struct.isSetDeadlock()) {
        struct.deadlock.write(oprot);
      }
      if (struct.isSetFileDescriptor()) {
        struct.fileDescriptor.write(oprot);
      }
      if (struct.isSetDirectBuffer()) {
        struct.directBuffer.write(oprot);
      }
      if (struct.isSetTotalThreadCount()) {
        struct.totalThreadCount.write(oprot);
      }
      if (struct.isSetLoadedClass()) {
        struct.loadedClass.write(oprot);
      }
      if (struct.isSetMetadata()) {
        oprot.writeString(struct.metadata);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TAgentStat struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(16);
      if (incoming.get(0)) {
        struct.agentId = iprot.readString();
        struct.setAgentIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.startTimestamp = iprot.readI64();
        struct.setStartTimestampIsSet(true);
      }
      if (incoming.get(2)) {
        struct.timestamp = iprot.readI64();
        struct.setTimestampIsSet(true);
      }
      if (incoming.get(3)) {
        struct.collectInterval = iprot.readI64();
        struct.setCollectIntervalIsSet(true);
      }
      if (incoming.get(4)) {
        struct.gc = new TJvmGc();
        struct.gc.read(iprot);
        struct.setGcIsSet(true);
      }
      if (incoming.get(5)) {
        struct.cpuLoad = new TCpuLoad();
        struct.cpuLoad.read(iprot);
        struct.setCpuLoadIsSet(true);
      }
      if (incoming.get(6)) {
        struct.transaction = new TTransaction();
        struct.transaction.read(iprot);
        struct.setTransactionIsSet(true);
      }
      if (incoming.get(7)) {
        struct.activeTrace = new TActiveTrace();
        struct.activeTrace.read(iprot);
        struct.setActiveTraceIsSet(true);
      }
      if (incoming.get(8)) {
        struct.dataSourceList = new TDataSourceList();
        struct.dataSourceList.read(iprot);
        struct.setDataSourceListIsSet(true);
      }
      if (incoming.get(9)) {
        struct.responseTime = new TResponseTime();
        struct.responseTime.read(iprot);
        struct.setResponseTimeIsSet(true);
      }
      if (incoming.get(10)) {
        struct.deadlock = new TDeadlock();
        struct.deadlock.read(iprot);
        struct.setDeadlockIsSet(true);
      }
      if (incoming.get(11)) {
        struct.fileDescriptor = new TFileDescriptor();
        struct.fileDescriptor.read(iprot);
        struct.setFileDescriptorIsSet(true);
      }
      if (incoming.get(12)) {
        struct.directBuffer = new TDirectBuffer();
        struct.directBuffer.read(iprot);
        struct.setDirectBufferIsSet(true);
      }
      if (incoming.get(13)) {
        struct.totalThreadCount = new TTotalThreadCount();
        struct.totalThreadCount.read(iprot);
        struct.setTotalThreadCountIsSet(true);
      }
      if (incoming.get(14)) {
        struct.loadedClass = new TLoadedClass();
        struct.loadedClass.read(iprot);
        struct.setLoadedClassIsSet(true);
      }
      if (incoming.get(15)) {
        struct.metadata = iprot.readString();
        struct.setMetadataIsSet(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();
  }
}

