com.uber.cadence.TaskListStatus Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.uber.cadence;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-06-18")
public class TaskListStatus 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("TaskListStatus");
private static final org.apache.thrift.protocol.TField BACKLOG_COUNT_HINT_FIELD_DESC = new org.apache.thrift.protocol.TField("backlogCountHint", org.apache.thrift.protocol.TType.I64, (short)10);
private static final org.apache.thrift.protocol.TField READ_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("readLevel", org.apache.thrift.protocol.TType.I64, (short)20);
private static final org.apache.thrift.protocol.TField ACK_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("ackLevel", org.apache.thrift.protocol.TType.I64, (short)30);
private static final org.apache.thrift.protocol.TField RATE_PER_SECOND_FIELD_DESC = new org.apache.thrift.protocol.TField("ratePerSecond", org.apache.thrift.protocol.TType.DOUBLE, (short)35);
private static final org.apache.thrift.protocol.TField TASK_IDBLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("taskIDBlock", org.apache.thrift.protocol.TType.STRUCT, (short)40);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TaskListStatusStandardSchemeFactory());
schemes.put(TupleScheme.class, new TaskListStatusTupleSchemeFactory());
}
public long backlogCountHint; // optional
public long readLevel; // optional
public long ackLevel; // optional
public double ratePerSecond; // optional
public TaskIDBlock taskIDBlock; // 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 {
BACKLOG_COUNT_HINT((short)10, "backlogCountHint"),
READ_LEVEL((short)20, "readLevel"),
ACK_LEVEL((short)30, "ackLevel"),
RATE_PER_SECOND((short)35, "ratePerSecond"),
TASK_IDBLOCK((short)40, "taskIDBlock");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 10: // BACKLOG_COUNT_HINT
return BACKLOG_COUNT_HINT;
case 20: // READ_LEVEL
return READ_LEVEL;
case 30: // ACK_LEVEL
return ACK_LEVEL;
case 35: // RATE_PER_SECOND
return RATE_PER_SECOND;
case 40: // TASK_IDBLOCK
return TASK_IDBLOCK;
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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __BACKLOGCOUNTHINT_ISSET_ID = 0;
private static final int __READLEVEL_ISSET_ID = 1;
private static final int __ACKLEVEL_ISSET_ID = 2;
private static final int __RATEPERSECOND_ISSET_ID = 3;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.BACKLOG_COUNT_HINT,_Fields.READ_LEVEL,_Fields.ACK_LEVEL,_Fields.RATE_PER_SECOND,_Fields.TASK_IDBLOCK};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.BACKLOG_COUNT_HINT, new org.apache.thrift.meta_data.FieldMetaData("backlogCountHint", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.READ_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("readLevel", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.ACK_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("ackLevel", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.RATE_PER_SECOND, new org.apache.thrift.meta_data.FieldMetaData("ratePerSecond", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
tmpMap.put(_Fields.TASK_IDBLOCK, new org.apache.thrift.meta_data.FieldMetaData("taskIDBlock", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TaskIDBlock")));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskListStatus.class, metaDataMap);
}
public TaskListStatus() {
}
/**
* Performs a deep copy on other.
*/
public TaskListStatus(TaskListStatus other) {
__isset_bitfield = other.__isset_bitfield;
this.backlogCountHint = other.backlogCountHint;
this.readLevel = other.readLevel;
this.ackLevel = other.ackLevel;
this.ratePerSecond = other.ratePerSecond;
if (other.isSetTaskIDBlock()) {
this.taskIDBlock = other.taskIDBlock;
}
}
public TaskListStatus deepCopy() {
return new TaskListStatus(this);
}
@Override
public void clear() {
setBacklogCountHintIsSet(false);
this.backlogCountHint = 0;
setReadLevelIsSet(false);
this.readLevel = 0;
setAckLevelIsSet(false);
this.ackLevel = 0;
setRatePerSecondIsSet(false);
this.ratePerSecond = 0.0;
this.taskIDBlock = null;
}
public long getBacklogCountHint() {
return this.backlogCountHint;
}
public TaskListStatus setBacklogCountHint(long backlogCountHint) {
this.backlogCountHint = backlogCountHint;
setBacklogCountHintIsSet(true);
return this;
}
public void unsetBacklogCountHint() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID);
}
/** Returns true if field backlogCountHint is set (has been assigned a value) and false otherwise */
public boolean isSetBacklogCountHint() {
return EncodingUtils.testBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID);
}
public void setBacklogCountHintIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID, value);
}
public long getReadLevel() {
return this.readLevel;
}
public TaskListStatus setReadLevel(long readLevel) {
this.readLevel = readLevel;
setReadLevelIsSet(true);
return this;
}
public void unsetReadLevel() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __READLEVEL_ISSET_ID);
}
/** Returns true if field readLevel is set (has been assigned a value) and false otherwise */
public boolean isSetReadLevel() {
return EncodingUtils.testBit(__isset_bitfield, __READLEVEL_ISSET_ID);
}
public void setReadLevelIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __READLEVEL_ISSET_ID, value);
}
public long getAckLevel() {
return this.ackLevel;
}
public TaskListStatus setAckLevel(long ackLevel) {
this.ackLevel = ackLevel;
setAckLevelIsSet(true);
return this;
}
public void unsetAckLevel() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKLEVEL_ISSET_ID);
}
/** Returns true if field ackLevel is set (has been assigned a value) and false otherwise */
public boolean isSetAckLevel() {
return EncodingUtils.testBit(__isset_bitfield, __ACKLEVEL_ISSET_ID);
}
public void setAckLevelIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKLEVEL_ISSET_ID, value);
}
public double getRatePerSecond() {
return this.ratePerSecond;
}
public TaskListStatus setRatePerSecond(double ratePerSecond) {
this.ratePerSecond = ratePerSecond;
setRatePerSecondIsSet(true);
return this;
}
public void unsetRatePerSecond() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID);
}
/** Returns true if field ratePerSecond is set (has been assigned a value) and false otherwise */
public boolean isSetRatePerSecond() {
return EncodingUtils.testBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID);
}
public void setRatePerSecondIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID, value);
}
public TaskIDBlock getTaskIDBlock() {
return this.taskIDBlock;
}
public TaskListStatus setTaskIDBlock(TaskIDBlock taskIDBlock) {
this.taskIDBlock = taskIDBlock;
return this;
}
public void unsetTaskIDBlock() {
this.taskIDBlock = null;
}
/** Returns true if field taskIDBlock is set (has been assigned a value) and false otherwise */
public boolean isSetTaskIDBlock() {
return this.taskIDBlock != null;
}
public void setTaskIDBlockIsSet(boolean value) {
if (!value) {
this.taskIDBlock = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BACKLOG_COUNT_HINT:
if (value == null) {
unsetBacklogCountHint();
} else {
setBacklogCountHint((Long)value);
}
break;
case READ_LEVEL:
if (value == null) {
unsetReadLevel();
} else {
setReadLevel((Long)value);
}
break;
case ACK_LEVEL:
if (value == null) {
unsetAckLevel();
} else {
setAckLevel((Long)value);
}
break;
case RATE_PER_SECOND:
if (value == null) {
unsetRatePerSecond();
} else {
setRatePerSecond((Double)value);
}
break;
case TASK_IDBLOCK:
if (value == null) {
unsetTaskIDBlock();
} else {
setTaskIDBlock((TaskIDBlock)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BACKLOG_COUNT_HINT:
return getBacklogCountHint();
case READ_LEVEL:
return getReadLevel();
case ACK_LEVEL:
return getAckLevel();
case RATE_PER_SECOND:
return getRatePerSecond();
case TASK_IDBLOCK:
return getTaskIDBlock();
}
throw new 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 IllegalArgumentException();
}
switch (field) {
case BACKLOG_COUNT_HINT:
return isSetBacklogCountHint();
case READ_LEVEL:
return isSetReadLevel();
case ACK_LEVEL:
return isSetAckLevel();
case RATE_PER_SECOND:
return isSetRatePerSecond();
case TASK_IDBLOCK:
return isSetTaskIDBlock();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TaskListStatus)
return this.equals((TaskListStatus)that);
return false;
}
public boolean equals(TaskListStatus that) {
if (that == null)
return false;
boolean this_present_backlogCountHint = true && this.isSetBacklogCountHint();
boolean that_present_backlogCountHint = true && that.isSetBacklogCountHint();
if (this_present_backlogCountHint || that_present_backlogCountHint) {
if (!(this_present_backlogCountHint && that_present_backlogCountHint))
return false;
if (this.backlogCountHint != that.backlogCountHint)
return false;
}
boolean this_present_readLevel = true && this.isSetReadLevel();
boolean that_present_readLevel = true && that.isSetReadLevel();
if (this_present_readLevel || that_present_readLevel) {
if (!(this_present_readLevel && that_present_readLevel))
return false;
if (this.readLevel != that.readLevel)
return false;
}
boolean this_present_ackLevel = true && this.isSetAckLevel();
boolean that_present_ackLevel = true && that.isSetAckLevel();
if (this_present_ackLevel || that_present_ackLevel) {
if (!(this_present_ackLevel && that_present_ackLevel))
return false;
if (this.ackLevel != that.ackLevel)
return false;
}
boolean this_present_ratePerSecond = true && this.isSetRatePerSecond();
boolean that_present_ratePerSecond = true && that.isSetRatePerSecond();
if (this_present_ratePerSecond || that_present_ratePerSecond) {
if (!(this_present_ratePerSecond && that_present_ratePerSecond))
return false;
if (this.ratePerSecond != that.ratePerSecond)
return false;
}
boolean this_present_taskIDBlock = true && this.isSetTaskIDBlock();
boolean that_present_taskIDBlock = true && that.isSetTaskIDBlock();
if (this_present_taskIDBlock || that_present_taskIDBlock) {
if (!(this_present_taskIDBlock && that_present_taskIDBlock))
return false;
if (!this.taskIDBlock.equals(that.taskIDBlock))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy