
com.adgear.anoa.test.nested.BytesThrift 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.adgear.anoa.test.nested;
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.2)", date = "2016-6-3")
public class BytesThrift 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("BytesThrift");
private static final org.apache.thrift.protocol.TField BYTES_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("bytes_field", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField BYTES_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("bytes_list", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField BYTES_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("bytes_map", org.apache.thrift.protocol.TType.MAP, (short)3);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new BytesThriftStandardSchemeFactory());
schemes.put(TupleScheme.class, new BytesThriftTupleSchemeFactory());
}
public ByteBuffer bytes_field; // optional
public List bytes_list; // optional
public Map bytes_map; // 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 {
BYTES_FIELD((short)1, "bytes_field"),
BYTES_LIST((short)2, "bytes_list"),
BYTES_MAP((short)3, "bytes_map");
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: // BYTES_FIELD
return BYTES_FIELD;
case 2: // BYTES_LIST
return BYTES_LIST;
case 3: // BYTES_MAP
return BYTES_MAP;
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 _Fields optionals[] = {_Fields.BYTES_FIELD,_Fields.BYTES_LIST,_Fields.BYTES_MAP};
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.BYTES_FIELD, new org.apache.thrift.meta_data.FieldMetaData("bytes_field", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.BYTES_LIST, new org.apache.thrift.meta_data.FieldMetaData("bytes_list", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
tmpMap.put(_Fields.BYTES_MAP, new org.apache.thrift.meta_data.FieldMetaData("bytes_map", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BytesThrift.class, metaDataMap);
}
public BytesThrift() {
this.bytes_field = java.nio.ByteBuffer.wrap(new byte[0]);
}
/**
* Performs a deep copy on other.
*/
public BytesThrift(BytesThrift other) {
if (other.isSetBytes_field()) {
this.bytes_field = org.apache.thrift.TBaseHelper.copyBinary(other.bytes_field);
}
if (other.isSetBytes_list()) {
List __this__bytes_list = new ArrayList(other.bytes_list);
this.bytes_list = __this__bytes_list;
}
if (other.isSetBytes_map()) {
Map __this__bytes_map = new HashMap(other.bytes_map);
this.bytes_map = __this__bytes_map;
}
}
public BytesThrift deepCopy() {
return new BytesThrift(this);
}
@Override
public void clear() {
this.bytes_field = java.nio.ByteBuffer.wrap(new byte[0]);
this.bytes_list = null;
this.bytes_map = null;
}
public byte[] getBytes_field() {
setBytes_field(org.apache.thrift.TBaseHelper.rightSize(bytes_field));
return bytes_field == null ? null : bytes_field.array();
}
public ByteBuffer bufferForBytes_field() {
return org.apache.thrift.TBaseHelper.copyBinary(bytes_field);
}
public BytesThrift setBytes_field(byte[] bytes_field) {
this.bytes_field = bytes_field == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(bytes_field, bytes_field.length));
return this;
}
public BytesThrift setBytes_field(ByteBuffer bytes_field) {
this.bytes_field = org.apache.thrift.TBaseHelper.copyBinary(bytes_field);
return this;
}
public void unsetBytes_field() {
this.bytes_field = null;
}
/** Returns true if field bytes_field is set (has been assigned a value) and false otherwise */
public boolean isSetBytes_field() {
return this.bytes_field != null;
}
public void setBytes_fieldIsSet(boolean value) {
if (!value) {
this.bytes_field = null;
}
}
public int getBytes_listSize() {
return (this.bytes_list == null) ? 0 : this.bytes_list.size();
}
public java.util.Iterator getBytes_listIterator() {
return (this.bytes_list == null) ? null : this.bytes_list.iterator();
}
public void addToBytes_list(ByteBuffer elem) {
if (this.bytes_list == null) {
this.bytes_list = new ArrayList();
}
this.bytes_list.add(elem);
}
public List getBytes_list() {
return this.bytes_list;
}
public BytesThrift setBytes_list(List bytes_list) {
this.bytes_list = bytes_list;
return this;
}
public void unsetBytes_list() {
this.bytes_list = null;
}
/** Returns true if field bytes_list is set (has been assigned a value) and false otherwise */
public boolean isSetBytes_list() {
return this.bytes_list != null;
}
public void setBytes_listIsSet(boolean value) {
if (!value) {
this.bytes_list = null;
}
}
public int getBytes_mapSize() {
return (this.bytes_map == null) ? 0 : this.bytes_map.size();
}
public void putToBytes_map(String key, ByteBuffer val) {
if (this.bytes_map == null) {
this.bytes_map = new HashMap();
}
this.bytes_map.put(key, val);
}
public Map getBytes_map() {
return this.bytes_map;
}
public BytesThrift setBytes_map(Map bytes_map) {
this.bytes_map = bytes_map;
return this;
}
public void unsetBytes_map() {
this.bytes_map = null;
}
/** Returns true if field bytes_map is set (has been assigned a value) and false otherwise */
public boolean isSetBytes_map() {
return this.bytes_map != null;
}
public void setBytes_mapIsSet(boolean value) {
if (!value) {
this.bytes_map = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case BYTES_FIELD:
if (value == null) {
unsetBytes_field();
} else {
setBytes_field((ByteBuffer)value);
}
break;
case BYTES_LIST:
if (value == null) {
unsetBytes_list();
} else {
setBytes_list((List)value);
}
break;
case BYTES_MAP:
if (value == null) {
unsetBytes_map();
} else {
setBytes_map((Map)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case BYTES_FIELD:
return getBytes_field();
case BYTES_LIST:
return getBytes_list();
case BYTES_MAP:
return getBytes_map();
}
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 BYTES_FIELD:
return isSetBytes_field();
case BYTES_LIST:
return isSetBytes_list();
case BYTES_MAP:
return isSetBytes_map();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof BytesThrift)
return this.equals((BytesThrift)that);
return false;
}
public boolean equals(BytesThrift that) {
if (that == null)
return false;
boolean this_present_bytes_field = true && this.isSetBytes_field();
boolean that_present_bytes_field = true && that.isSetBytes_field();
if (this_present_bytes_field || that_present_bytes_field) {
if (!(this_present_bytes_field && that_present_bytes_field))
return false;
if (!this.bytes_field.equals(that.bytes_field))
return false;
}
boolean this_present_bytes_list = true && this.isSetBytes_list();
boolean that_present_bytes_list = true && that.isSetBytes_list();
if (this_present_bytes_list || that_present_bytes_list) {
if (!(this_present_bytes_list && that_present_bytes_list))
return false;
if (!this.bytes_list.equals(that.bytes_list))
return false;
}
boolean this_present_bytes_map = true && this.isSetBytes_map();
boolean that_present_bytes_map = true && that.isSetBytes_map();
if (this_present_bytes_map || that_present_bytes_map) {
if (!(this_present_bytes_map && that_present_bytes_map))
return false;
if (!this.bytes_map.equals(that.bytes_map))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy