com.xiaomi.infra.galaxy.emr.thrift.BillItem Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.9.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.xiaomi.infra.galaxy.emr.thrift;
import libthrift091.scheme.IScheme;
import libthrift091.scheme.SchemeFactory;
import libthrift091.scheme.StandardScheme;
import libthrift091.scheme.TupleScheme;
import libthrift091.protocol.TTupleProtocol;
import libthrift091.protocol.TProtocolException;
import libthrift091.EncodingUtils;
import libthrift091.TException;
import libthrift091.async.AsyncMethodCallback;
import libthrift091.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.2)", date = "2016-8-2")
public class BillItem implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("BillItem");
private static final libthrift091.protocol.TField NAME_FIELD_DESC = new libthrift091.protocol.TField("name", libthrift091.protocol.TType.STRING, (short)1);
private static final libthrift091.protocol.TField USAGE_FIELD_DESC = new libthrift091.protocol.TField("usage", libthrift091.protocol.TType.I32, (short)2);
private static final libthrift091.protocol.TField UNIT_COST_FIELD_DESC = new libthrift091.protocol.TField("unitCost", libthrift091.protocol.TType.DOUBLE, (short)3);
private static final libthrift091.protocol.TField UNIT_FIELD_DESC = new libthrift091.protocol.TField("unit", libthrift091.protocol.TType.STRING, (short)4);
private static final libthrift091.protocol.TField TOTAL_COST_FIELD_DESC = new libthrift091.protocol.TField("totalCost", libthrift091.protocol.TType.DOUBLE, (short)5);
private static final libthrift091.protocol.TField START_TIME_FIELD_DESC = new libthrift091.protocol.TField("startTime", libthrift091.protocol.TType.STRING, (short)6);
private static final libthrift091.protocol.TField END_TIME_FIELD_DESC = new libthrift091.protocol.TField("endTime", libthrift091.protocol.TType.STRING, (short)7);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new BillItemStandardSchemeFactory());
schemes.put(TupleScheme.class, new BillItemTupleSchemeFactory());
}
public String name; // required
public int usage; // required
public double unitCost; // required
public String unit; // required
public double totalCost; // required
public String startTime; // required
public String endTime; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
NAME((short)1, "name"),
USAGE((short)2, "usage"),
UNIT_COST((short)3, "unitCost"),
UNIT((short)4, "unit"),
TOTAL_COST((short)5, "totalCost"),
START_TIME((short)6, "startTime"),
END_TIME((short)7, "endTime");
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 1: // NAME
return NAME;
case 2: // USAGE
return USAGE;
case 3: // UNIT_COST
return UNIT_COST;
case 4: // UNIT
return UNIT;
case 5: // TOTAL_COST
return TOTAL_COST;
case 6: // START_TIME
return START_TIME;
case 7: // END_TIME
return END_TIME;
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 __USAGE_ISSET_ID = 0;
private static final int __UNITCOST_ISSET_ID = 1;
private static final int __TOTALCOST_ISSET_ID = 2;
private byte __isset_bitfield = 0;
public static final Map<_Fields, libthrift091.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.NAME, new libthrift091.meta_data.FieldMetaData("name", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.USAGE, new libthrift091.meta_data.FieldMetaData("usage", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32)));
tmpMap.put(_Fields.UNIT_COST, new libthrift091.meta_data.FieldMetaData("unitCost", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.DOUBLE)));
tmpMap.put(_Fields.UNIT, new libthrift091.meta_data.FieldMetaData("unit", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.TOTAL_COST, new libthrift091.meta_data.FieldMetaData("totalCost", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.DOUBLE)));
tmpMap.put(_Fields.START_TIME, new libthrift091.meta_data.FieldMetaData("startTime", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
tmpMap.put(_Fields.END_TIME, new libthrift091.meta_data.FieldMetaData("endTime", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(BillItem.class, metaDataMap);
}
public BillItem() {
}
public BillItem(
String name,
int usage,
double unitCost,
String unit,
double totalCost,
String startTime,
String endTime)
{
this();
this.name = name;
this.usage = usage;
setUsageIsSet(true);
this.unitCost = unitCost;
setUnitCostIsSet(true);
this.unit = unit;
this.totalCost = totalCost;
setTotalCostIsSet(true);
this.startTime = startTime;
this.endTime = endTime;
}
/**
* Performs a deep copy on other.
*/
public BillItem(BillItem other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetName()) {
this.name = other.name;
}
this.usage = other.usage;
this.unitCost = other.unitCost;
if (other.isSetUnit()) {
this.unit = other.unit;
}
this.totalCost = other.totalCost;
if (other.isSetStartTime()) {
this.startTime = other.startTime;
}
if (other.isSetEndTime()) {
this.endTime = other.endTime;
}
}
public BillItem deepCopy() {
return new BillItem(this);
}
@Override
public void clear() {
this.name = null;
setUsageIsSet(false);
this.usage = 0;
setUnitCostIsSet(false);
this.unitCost = 0.0;
this.unit = null;
setTotalCostIsSet(false);
this.totalCost = 0.0;
this.startTime = null;
this.endTime = null;
}
public String getName() {
return this.name;
}
public BillItem setName(String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public int getUsage() {
return this.usage;
}
public BillItem setUsage(int usage) {
this.usage = usage;
setUsageIsSet(true);
return this;
}
public void unsetUsage() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USAGE_ISSET_ID);
}
/** Returns true if field usage is set (has been assigned a value) and false otherwise */
public boolean isSetUsage() {
return EncodingUtils.testBit(__isset_bitfield, __USAGE_ISSET_ID);
}
public void setUsageIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USAGE_ISSET_ID, value);
}
public double getUnitCost() {
return this.unitCost;
}
public BillItem setUnitCost(double unitCost) {
this.unitCost = unitCost;
setUnitCostIsSet(true);
return this;
}
public void unsetUnitCost() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UNITCOST_ISSET_ID);
}
/** Returns true if field unitCost is set (has been assigned a value) and false otherwise */
public boolean isSetUnitCost() {
return EncodingUtils.testBit(__isset_bitfield, __UNITCOST_ISSET_ID);
}
public void setUnitCostIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UNITCOST_ISSET_ID, value);
}
public String getUnit() {
return this.unit;
}
public BillItem setUnit(String unit) {
this.unit = unit;
return this;
}
public void unsetUnit() {
this.unit = null;
}
/** Returns true if field unit is set (has been assigned a value) and false otherwise */
public boolean isSetUnit() {
return this.unit != null;
}
public void setUnitIsSet(boolean value) {
if (!value) {
this.unit = null;
}
}
public double getTotalCost() {
return this.totalCost;
}
public BillItem setTotalCost(double totalCost) {
this.totalCost = totalCost;
setTotalCostIsSet(true);
return this;
}
public void unsetTotalCost() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALCOST_ISSET_ID);
}
/** Returns true if field totalCost is set (has been assigned a value) and false otherwise */
public boolean isSetTotalCost() {
return EncodingUtils.testBit(__isset_bitfield, __TOTALCOST_ISSET_ID);
}
public void setTotalCostIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALCOST_ISSET_ID, value);
}
public String getStartTime() {
return this.startTime;
}
public BillItem setStartTime(String startTime) {
this.startTime = startTime;
return this;
}
public void unsetStartTime() {
this.startTime = null;
}
/** Returns true if field startTime is set (has been assigned a value) and false otherwise */
public boolean isSetStartTime() {
return this.startTime != null;
}
public void setStartTimeIsSet(boolean value) {
if (!value) {
this.startTime = null;
}
}
public String getEndTime() {
return this.endTime;
}
public BillItem setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
public void unsetEndTime() {
this.endTime = null;
}
/** Returns true if field endTime is set (has been assigned a value) and false otherwise */
public boolean isSetEndTime() {
return this.endTime != null;
}
public void setEndTimeIsSet(boolean value) {
if (!value) {
this.endTime = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((String)value);
}
break;
case USAGE:
if (value == null) {
unsetUsage();
} else {
setUsage((Integer)value);
}
break;
case UNIT_COST:
if (value == null) {
unsetUnitCost();
} else {
setUnitCost((Double)value);
}
break;
case UNIT:
if (value == null) {
unsetUnit();
} else {
setUnit((String)value);
}
break;
case TOTAL_COST:
if (value == null) {
unsetTotalCost();
} else {
setTotalCost((Double)value);
}
break;
case START_TIME:
if (value == null) {
unsetStartTime();
} else {
setStartTime((String)value);
}
break;
case END_TIME:
if (value == null) {
unsetEndTime();
} else {
setEndTime((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case USAGE:
return Integer.valueOf(getUsage());
case UNIT_COST:
return Double.valueOf(getUnitCost());
case UNIT:
return getUnit();
case TOTAL_COST:
return Double.valueOf(getTotalCost());
case START_TIME:
return getStartTime();
case END_TIME:
return getEndTime();
}
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 NAME:
return isSetName();
case USAGE:
return isSetUsage();
case UNIT_COST:
return isSetUnitCost();
case UNIT:
return isSetUnit();
case TOTAL_COST:
return isSetTotalCost();
case START_TIME:
return isSetStartTime();
case END_TIME:
return isSetEndTime();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof BillItem)
return this.equals((BillItem)that);
return false;
}
public boolean equals(BillItem that) {
if (that == null)
return false;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
if (!this.name.equals(that.name))
return false;
}
boolean this_present_usage = true;
boolean that_present_usage = true;
if (this_present_usage || that_present_usage) {
if (!(this_present_usage && that_present_usage))
return false;
if (this.usage != that.usage)
return false;
}
boolean this_present_unitCost = true;
boolean that_present_unitCost = true;
if (this_present_unitCost || that_present_unitCost) {
if (!(this_present_unitCost && that_present_unitCost))
return false;
if (this.unitCost != that.unitCost)
return false;
}
boolean this_present_unit = true && this.isSetUnit();
boolean that_present_unit = true && that.isSetUnit();
if (this_present_unit || that_present_unit) {
if (!(this_present_unit && that_present_unit))
return false;
if (!this.unit.equals(that.unit))
return false;
}
boolean this_present_totalCost = true;
boolean that_present_totalCost = true;
if (this_present_totalCost || that_present_totalCost) {
if (!(this_present_totalCost && that_present_totalCost))
return false;
if (this.totalCost != that.totalCost)
return false;
}
boolean this_present_startTime = true && this.isSetStartTime();
boolean that_present_startTime = true && that.isSetStartTime();
if (this_present_startTime || that_present_startTime) {
if (!(this_present_startTime && that_present_startTime))
return false;
if (!this.startTime.equals(that.startTime))
return false;
}
boolean this_present_endTime = true && this.isSetEndTime();
boolean that_present_endTime = true && that.isSetEndTime();
if (this_present_endTime || that_present_endTime) {
if (!(this_present_endTime && that_present_endTime))
return false;
if (!this.endTime.equals(that.endTime))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy