
com.bendb.thrifty.test.gen.Xtruct Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.bendb.thrifty.test.gen;
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 = "2016-01-04")
public class Xtruct 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("Xtruct");
private static final org.apache.thrift.protocol.TField STRING_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("string_thing", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField BYTE_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("byte_thing", org.apache.thrift.protocol.TType.BYTE, (short)4);
private static final org.apache.thrift.protocol.TField I32_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("i32_thing", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField I64_THING_FIELD_DESC = new org.apache.thrift.protocol.TField("i64_thing", org.apache.thrift.protocol.TType.I64, (short)11);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new XtructStandardSchemeFactory());
schemes.put(TupleScheme.class, new XtructTupleSchemeFactory());
}
public String string_thing; // required
public byte byte_thing; // required
public int i32_thing; // required
public long i64_thing; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
STRING_THING((short)1, "string_thing"),
BYTE_THING((short)4, "byte_thing"),
I32_THING((short)9, "i32_thing"),
I64_THING((short)11, "i64_thing");
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: // STRING_THING
return STRING_THING;
case 4: // BYTE_THING
return BYTE_THING;
case 9: // I32_THING
return I32_THING;
case 11: // I64_THING
return I64_THING;
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 __BYTE_THING_ISSET_ID = 0;
private static final int __I32_THING_ISSET_ID = 1;
private static final int __I64_THING_ISSET_ID = 2;
private byte __isset_bitfield = 0;
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.STRING_THING, new org.apache.thrift.meta_data.FieldMetaData("string_thing", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.BYTE_THING, new org.apache.thrift.meta_data.FieldMetaData("byte_thing", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
tmpMap.put(_Fields.I32_THING, new org.apache.thrift.meta_data.FieldMetaData("i32_thing", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.I64_THING, new org.apache.thrift.meta_data.FieldMetaData("i64_thing", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Xtruct.class, metaDataMap);
}
public Xtruct() {
}
public Xtruct(
String string_thing,
byte byte_thing,
int i32_thing,
long i64_thing)
{
this();
this.string_thing = string_thing;
this.byte_thing = byte_thing;
setByte_thingIsSet(true);
this.i32_thing = i32_thing;
setI32_thingIsSet(true);
this.i64_thing = i64_thing;
setI64_thingIsSet(true);
}
/**
* Performs a deep copy on other.
*/
public Xtruct(Xtruct other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetString_thing()) {
this.string_thing = other.string_thing;
}
this.byte_thing = other.byte_thing;
this.i32_thing = other.i32_thing;
this.i64_thing = other.i64_thing;
}
public Xtruct deepCopy() {
return new Xtruct(this);
}
@Override
public void clear() {
this.string_thing = null;
setByte_thingIsSet(false);
this.byte_thing = 0;
setI32_thingIsSet(false);
this.i32_thing = 0;
setI64_thingIsSet(false);
this.i64_thing = 0;
}
public String getString_thing() {
return this.string_thing;
}
public Xtruct setString_thing(String string_thing) {
this.string_thing = string_thing;
return this;
}
public void unsetString_thing() {
this.string_thing = null;
}
/** Returns true if field string_thing is set (has been assigned a value) and false otherwise */
public boolean isSetString_thing() {
return this.string_thing != null;
}
public void setString_thingIsSet(boolean value) {
if (!value) {
this.string_thing = null;
}
}
public byte getByte_thing() {
return this.byte_thing;
}
public Xtruct setByte_thing(byte byte_thing) {
this.byte_thing = byte_thing;
setByte_thingIsSet(true);
return this;
}
public void unsetByte_thing() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BYTE_THING_ISSET_ID);
}
/** Returns true if field byte_thing is set (has been assigned a value) and false otherwise */
public boolean isSetByte_thing() {
return EncodingUtils.testBit(__isset_bitfield, __BYTE_THING_ISSET_ID);
}
public void setByte_thingIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BYTE_THING_ISSET_ID, value);
}
public int getI32_thing() {
return this.i32_thing;
}
public Xtruct setI32_thing(int i32_thing) {
this.i32_thing = i32_thing;
setI32_thingIsSet(true);
return this;
}
public void unsetI32_thing() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I32_THING_ISSET_ID);
}
/** Returns true if field i32_thing is set (has been assigned a value) and false otherwise */
public boolean isSetI32_thing() {
return EncodingUtils.testBit(__isset_bitfield, __I32_THING_ISSET_ID);
}
public void setI32_thingIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I32_THING_ISSET_ID, value);
}
public long getI64_thing() {
return this.i64_thing;
}
public Xtruct setI64_thing(long i64_thing) {
this.i64_thing = i64_thing;
setI64_thingIsSet(true);
return this;
}
public void unsetI64_thing() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I64_THING_ISSET_ID);
}
/** Returns true if field i64_thing is set (has been assigned a value) and false otherwise */
public boolean isSetI64_thing() {
return EncodingUtils.testBit(__isset_bitfield, __I64_THING_ISSET_ID);
}
public void setI64_thingIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I64_THING_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STRING_THING:
if (value == null) {
unsetString_thing();
} else {
setString_thing((String)value);
}
break;
case BYTE_THING:
if (value == null) {
unsetByte_thing();
} else {
setByte_thing((Byte)value);
}
break;
case I32_THING:
if (value == null) {
unsetI32_thing();
} else {
setI32_thing((Integer)value);
}
break;
case I64_THING:
if (value == null) {
unsetI64_thing();
} else {
setI64_thing((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case STRING_THING:
return getString_thing();
case BYTE_THING:
return getByte_thing();
case I32_THING:
return getI32_thing();
case I64_THING:
return getI64_thing();
}
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 STRING_THING:
return isSetString_thing();
case BYTE_THING:
return isSetByte_thing();
case I32_THING:
return isSetI32_thing();
case I64_THING:
return isSetI64_thing();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Xtruct)
return this.equals((Xtruct)that);
return false;
}
public boolean equals(Xtruct that) {
if (that == null)
return false;
boolean this_present_string_thing = true && this.isSetString_thing();
boolean that_present_string_thing = true && that.isSetString_thing();
if (this_present_string_thing || that_present_string_thing) {
if (!(this_present_string_thing && that_present_string_thing))
return false;
if (!this.string_thing.equals(that.string_thing))
return false;
}
boolean this_present_byte_thing = true;
boolean that_present_byte_thing = true;
if (this_present_byte_thing || that_present_byte_thing) {
if (!(this_present_byte_thing && that_present_byte_thing))
return false;
if (this.byte_thing != that.byte_thing)
return false;
}
boolean this_present_i32_thing = true;
boolean that_present_i32_thing = true;
if (this_present_i32_thing || that_present_i32_thing) {
if (!(this_present_i32_thing && that_present_i32_thing))
return false;
if (this.i32_thing != that.i32_thing)
return false;
}
boolean this_present_i64_thing = true;
boolean that_present_i64_thing = true;
if (this_present_i64_thing || that_present_i64_thing) {
if (!(this_present_i64_thing && that_present_i64_thing))
return false;
if (this.i64_thing != that.i64_thing)
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy