
com.bendb.thrifty.test.gen.Insanity 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 Insanity 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("Insanity");
private static final org.apache.thrift.protocol.TField USER_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("userMap", org.apache.thrift.protocol.TType.MAP, (short)1);
private static final org.apache.thrift.protocol.TField XTRUCTS_FIELD_DESC = new org.apache.thrift.protocol.TField("xtructs", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new InsanityStandardSchemeFactory());
schemes.put(TupleScheme.class, new InsanityTupleSchemeFactory());
}
public Map userMap; // required
public List xtructs; // 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 {
USER_MAP((short)1, "userMap"),
XTRUCTS((short)2, "xtructs");
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: // USER_MAP
return USER_MAP;
case 2: // XTRUCTS
return XTRUCTS;
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
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.USER_MAP, new org.apache.thrift.meta_data.FieldMetaData("userMap", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Numberz.class),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UserId"))));
tmpMap.put(_Fields.XTRUCTS, new org.apache.thrift.meta_data.FieldMetaData("xtructs", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Xtruct.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insanity.class, metaDataMap);
}
public Insanity() {
}
public Insanity(
Map userMap,
List xtructs)
{
this();
this.userMap = userMap;
this.xtructs = xtructs;
}
/**
* Performs a deep copy on other.
*/
public Insanity(Insanity other) {
if (other.isSetUserMap()) {
Map __this__userMap = new HashMap(other.userMap.size());
for (Map.Entry other_element : other.userMap.entrySet()) {
Numberz other_element_key = other_element.getKey();
Long other_element_value = other_element.getValue();
Numberz __this__userMap_copy_key = other_element_key;
Long __this__userMap_copy_value = other_element_value;
__this__userMap.put(__this__userMap_copy_key, __this__userMap_copy_value);
}
this.userMap = __this__userMap;
}
if (other.isSetXtructs()) {
List __this__xtructs = new ArrayList(other.xtructs.size());
for (Xtruct other_element : other.xtructs) {
__this__xtructs.add(new Xtruct(other_element));
}
this.xtructs = __this__xtructs;
}
}
public Insanity deepCopy() {
return new Insanity(this);
}
@Override
public void clear() {
this.userMap = null;
this.xtructs = null;
}
public int getUserMapSize() {
return (this.userMap == null) ? 0 : this.userMap.size();
}
public void putToUserMap(Numberz key, long val) {
if (this.userMap == null) {
this.userMap = new HashMap();
}
this.userMap.put(key, val);
}
public Map getUserMap() {
return this.userMap;
}
public Insanity setUserMap(Map userMap) {
this.userMap = userMap;
return this;
}
public void unsetUserMap() {
this.userMap = null;
}
/** Returns true if field userMap is set (has been assigned a value) and false otherwise */
public boolean isSetUserMap() {
return this.userMap != null;
}
public void setUserMapIsSet(boolean value) {
if (!value) {
this.userMap = null;
}
}
public int getXtructsSize() {
return (this.xtructs == null) ? 0 : this.xtructs.size();
}
public java.util.Iterator getXtructsIterator() {
return (this.xtructs == null) ? null : this.xtructs.iterator();
}
public void addToXtructs(Xtruct elem) {
if (this.xtructs == null) {
this.xtructs = new ArrayList();
}
this.xtructs.add(elem);
}
public List getXtructs() {
return this.xtructs;
}
public Insanity setXtructs(List xtructs) {
this.xtructs = xtructs;
return this;
}
public void unsetXtructs() {
this.xtructs = null;
}
/** Returns true if field xtructs is set (has been assigned a value) and false otherwise */
public boolean isSetXtructs() {
return this.xtructs != null;
}
public void setXtructsIsSet(boolean value) {
if (!value) {
this.xtructs = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USER_MAP:
if (value == null) {
unsetUserMap();
} else {
setUserMap((Map)value);
}
break;
case XTRUCTS:
if (value == null) {
unsetXtructs();
} else {
setXtructs((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USER_MAP:
return getUserMap();
case XTRUCTS:
return getXtructs();
}
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 USER_MAP:
return isSetUserMap();
case XTRUCTS:
return isSetXtructs();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Insanity)
return this.equals((Insanity)that);
return false;
}
public boolean equals(Insanity that) {
if (that == null)
return false;
boolean this_present_userMap = true && this.isSetUserMap();
boolean that_present_userMap = true && that.isSetUserMap();
if (this_present_userMap || that_present_userMap) {
if (!(this_present_userMap && that_present_userMap))
return false;
if (!this.userMap.equals(that.userMap))
return false;
}
boolean this_present_xtructs = true && this.isSetXtructs();
boolean that_present_xtructs = true && that.isSetXtructs();
if (this_present_xtructs || that_present_xtructs) {
if (!(this_present_xtructs && that_present_xtructs))
return false;
if (!this.xtructs.equals(that.xtructs))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy