/** * Autogenerated by Thrift Compiler (1.0.0-dev) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.liveramp.hank.generated; import org.apache.commons.lang.builder.HashCodeBuilder; 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 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SmartClient { public interface Iface { public HankResponse get(String domain_name, ByteBuffer key) throws org.apache.thrift.TException; public HankBulkResponse getBulk(String domain_name, List<ByteBuffer> keys) throws org.apache.thrift.TException; } public interface AsyncIface { public void get(String domain_name, ByteBuffer key, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.get_call> resultHandler) throws org.apache.thrift.TException; public void getBulk(String domain_name, List<ByteBuffer> keys, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBulk_call> resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public HankResponse get(String domain_name, ByteBuffer key) throws org.apache.thrift.TException { send_get(domain_name, key); return recv_get(); } public void send_get(String domain_name, ByteBuffer key) throws org.apache.thrift.TException { get_args args = new get_args(); args.set_domain_name(domain_name); args.set_key(key); sendBase("get", args); } public HankResponse recv_get() throws org.apache.thrift.TException { get_result result = new get_result(); receiveBase(result, "get"); if (result.is_set_success()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result"); } public HankBulkResponse getBulk(String domain_name, List<ByteBuffer> keys) throws org.apache.thrift.TException { send_getBulk(domain_name, keys); return recv_getBulk(); } public void send_getBulk(String domain_name, List<ByteBuffer> keys) throws org.apache.thrift.TException { getBulk_args args = new getBulk_args(); args.set_domain_name(domain_name); args.set_keys(keys); sendBase("getBulk", args); } public HankBulkResponse recv_getBulk() throws org.apache.thrift.TException { getBulk_result result = new getBulk_result(); receiveBase(result, "getBulk"); if (result.is_set_success()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBulk failed: unknown result"); } } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void get(String domain_name, ByteBuffer key, org.apache.thrift.async.AsyncMethodCallback<get_call> resultHandler) throws org.apache.thrift.TException { checkReady(); get_call method_call = new get_call(domain_name, key, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class get_call extends org.apache.thrift.async.TAsyncMethodCall { private String domain_name; private ByteBuffer key; public get_call(String domain_name, ByteBuffer key, org.apache.thrift.async.AsyncMethodCallback<get_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.domain_name = domain_name; this.key = key; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get", org.apache.thrift.protocol.TMessageType.CALL, 0)); get_args args = new get_args(); args.set_domain_name(domain_name); args.set_key(key); args.write(prot); prot.writeMessageEnd(); } public HankResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_get(); } } public void getBulk(String domain_name, List<ByteBuffer> keys, org.apache.thrift.async.AsyncMethodCallback<getBulk_call> resultHandler) throws org.apache.thrift.TException { checkReady(); getBulk_call method_call = new getBulk_call(domain_name, keys, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getBulk_call extends org.apache.thrift.async.TAsyncMethodCall { private String domain_name; private List<ByteBuffer> keys; public getBulk_call(String domain_name, List<ByteBuffer> keys, org.apache.thrift.async.AsyncMethodCallback<getBulk_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.domain_name = domain_name; this.keys = keys; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBulk", org.apache.thrift.protocol.TMessageType.CALL, 0)); getBulk_args args = new getBulk_args(); args.set_domain_name(domain_name); args.set_keys(keys); args.write(prot); prot.writeMessageEnd(); } public HankBulkResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getBulk(); } } } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("get", new get()); processMap.put("getBulk", new getBulk()); return processMap; } public static class get<I extends Iface> extends org.apache.thrift.ProcessFunction<I, get_args> { public get() { super("get"); } public get_args getEmptyArgsInstance() { return new get_args(); } protected boolean isOneway() { return false; } public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { get_result result = new get_result(); result.success = iface.get(args.domain_name, args.key); return result; } } public static class getBulk<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getBulk_args> { public getBulk() { super("getBulk"); } public getBulk_args getEmptyArgsInstance() { return new getBulk_args(); } protected boolean isOneway() { return false; } public getBulk_result getResult(I iface, getBulk_args args) throws org.apache.thrift.TException { getBulk_result result = new getBulk_result(); result.success = iface.getBulk(args.domain_name, args.keys); return result; } } } public static class get_args implements org.apache.thrift.TBase<get_args, get_args._Fields>, java.io.Serializable, Cloneable, Comparable<get_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_args"); private static final org.apache.thrift.protocol.TField DOMAIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("domain_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new get_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory()); } public String domain_name; // required public ByteBuffer key; // 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 { DOMAIN_NAME((short)1, "domain_name"), KEY((short)2, "key"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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: // DOMAIN_NAME return DOMAIN_NAME; case 2: // KEY return KEY; 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.DOMAIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("domain_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, 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(get_args.class, metaDataMap); } public get_args() { } public get_args( String domain_name, ByteBuffer key) { this(); this.domain_name = domain_name; this.key = key; } /** * Performs a deep copy on <i>other</i>. */ public get_args(get_args other) { if (other.is_set_domain_name()) { this.domain_name = other.domain_name; } if (other.is_set_key()) { this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); ; } } public get_args deepCopy() { return new get_args(this); } @Override public void clear() { this.domain_name = null; this.key = null; } public String get_domain_name() { return this.domain_name; } public get_args set_domain_name(String domain_name) { this.domain_name = domain_name; return this; } public void unset_domain_name() { this.domain_name = null; } /** Returns true if field domain_name is set (has been assigned a value) and false otherwise */ public boolean is_set_domain_name() { return this.domain_name != null; } public void set_domain_name_isSet(boolean value) { if (!value) { this.domain_name = null; } } public byte[] get_key() { set_key(org.apache.thrift.TBaseHelper.rightSize(key)); return key == null ? null : key.array(); } public ByteBuffer buffer_for_key() { return key; } public get_args set_key(byte[] key) { set_key(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); return this; } public get_args set_key(ByteBuffer key) { this.key = key; return this; } public void unset_key() { this.key = null; } /** Returns true if field key is set (has been assigned a value) and false otherwise */ public boolean is_set_key() { return this.key != null; } public void set_key_isSet(boolean value) { if (!value) { this.key = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case DOMAIN_NAME: if (value == null) { unset_domain_name(); } else { set_domain_name((String)value); } break; case KEY: if (value == null) { unset_key(); } else { set_key((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DOMAIN_NAME: return get_domain_name(); case KEY: return get_key(); } 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 DOMAIN_NAME: return is_set_domain_name(); case KEY: return is_set_key(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_args) return this.equals((get_args)that); return false; } public boolean equals(get_args that) { if (that == null) return false; boolean this_present_domain_name = true && this.is_set_domain_name(); boolean that_present_domain_name = true && that.is_set_domain_name(); if (this_present_domain_name || that_present_domain_name) { if (!(this_present_domain_name && that_present_domain_name)) return false; if (!this.domain_name.equals(that.domain_name)) return false; } boolean this_present_key = true && this.is_set_key(); boolean that_present_key = true && that.is_set_key(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_domain_name = true && (is_set_domain_name()); builder.append(present_domain_name); if (present_domain_name) builder.append(domain_name); boolean present_key = true && (is_set_key()); builder.append(present_key); if (present_key) builder.append(key); return builder.toHashCode(); } @Override public int compareTo(get_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_domain_name()).compareTo(other.is_set_domain_name()); if (lastComparison != 0) { return lastComparison; } if (is_set_domain_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain_name, other.domain_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_key()).compareTo(other.is_set_key()); if (lastComparison != 0) { return lastComparison; } if (is_set_key()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_args("); boolean first = true; sb.append("domain_name:"); if (this.domain_name == null) { sb.append("null"); } else { sb.append(this.domain_name); } first = false; if (!first) sb.append(", "); sb.append("key:"); if (this.key == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.key, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class get_argsStandardSchemeFactory implements SchemeFactory { public get_argsStandardScheme getScheme() { return new get_argsStandardScheme(); } } private static class get_argsStandardScheme extends StandardScheme<get_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, get_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DOMAIN_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.domain_name = iprot.readString(); struct.set_domain_name_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readBinary(); struct.set_key_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, get_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.domain_name != null) { oprot.writeFieldBegin(DOMAIN_NAME_FIELD_DESC); oprot.writeString(struct.domain_name); oprot.writeFieldEnd(); } if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeBinary(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class get_argsTupleSchemeFactory implements SchemeFactory { public get_argsTupleScheme getScheme() { return new get_argsTupleScheme(); } } private static class get_argsTupleScheme extends TupleScheme<get_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.is_set_domain_name()) { optionals.set(0); } if (struct.is_set_key()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.is_set_domain_name()) { oprot.writeString(struct.domain_name); } if (struct.is_set_key()) { oprot.writeBinary(struct.key); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.domain_name = iprot.readString(); struct.set_domain_name_isSet(true); } if (incoming.get(1)) { struct.key = iprot.readBinary(); struct.set_key_isSet(true); } } } } public static class get_result implements org.apache.thrift.TBase<get_result, get_result._Fields>, java.io.Serializable, Cloneable, Comparable<get_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new get_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory()); } public HankResponse success; // 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 { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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 0: // SUCCESS return SUCCESS; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HankResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); } public get_result() { } public get_result( HankResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public get_result(get_result other) { if (other.is_set_success()) { this.success = new HankResponse(other.success); } } public get_result deepCopy() { return new get_result(this); } @Override public void clear() { this.success = null; } public HankResponse get_success() { return this.success; } public get_result set_success(HankResponse success) { this.success = success; return this; } public void unset_success() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean is_set_success() { return this.success != null; } public void set_success_isSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((HankResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return get_success(); } 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 SUCCESS: return is_set_success(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_result) return this.equals((get_result)that); return false; } public boolean equals(get_result that) { if (that == null) return false; boolean this_present_success = true && this.is_set_success(); boolean that_present_success = true && that.is_set_success(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_success = true && (is_set_success()); builder.append(present_success); if (present_success) builder.append(success); return builder.toHashCode(); } @Override public int compareTo(get_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class get_resultStandardSchemeFactory implements SchemeFactory { public get_resultStandardScheme getScheme() { return new get_resultStandardScheme(); } } private static class get_resultStandardScheme extends StandardScheme<get_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, get_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new HankResponse(); struct.success.read(iprot); struct.set_success_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, get_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class get_resultTupleSchemeFactory implements SchemeFactory { public get_resultTupleScheme getScheme() { return new get_resultTupleScheme(); } } private static class get_resultTupleScheme extends TupleScheme<get_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.is_set_success()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.is_set_success()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new HankResponse(); struct.success.read(iprot); struct.set_success_isSet(true); } } } } public static class getBulk_args implements org.apache.thrift.TBase<getBulk_args, getBulk_args._Fields>, java.io.Serializable, Cloneable, Comparable<getBulk_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBulk_args"); private static final org.apache.thrift.protocol.TField DOMAIN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("domain_name", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getBulk_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getBulk_argsTupleSchemeFactory()); } public String domain_name; // required public List<ByteBuffer> keys; // 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 { DOMAIN_NAME((short)1, "domain_name"), KEYS((short)2, "keys"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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: // DOMAIN_NAME return DOMAIN_NAME; case 2: // KEYS return KEYS; 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.DOMAIN_NAME, new org.apache.thrift.meta_data.FieldMetaData("domain_name", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.DEFAULT, 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)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBulk_args.class, metaDataMap); } public getBulk_args() { } public getBulk_args( String domain_name, List<ByteBuffer> keys) { this(); this.domain_name = domain_name; this.keys = keys; } /** * Performs a deep copy on <i>other</i>. */ public getBulk_args(getBulk_args other) { if (other.is_set_domain_name()) { this.domain_name = other.domain_name; } if (other.is_set_keys()) { List<ByteBuffer> __this__keys = new ArrayList<ByteBuffer>(); for (ByteBuffer other_element : other.keys) { ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); ; __this__keys.add(temp_binary_element); } this.keys = __this__keys; } } public getBulk_args deepCopy() { return new getBulk_args(this); } @Override public void clear() { this.domain_name = null; this.keys = null; } public String get_domain_name() { return this.domain_name; } public getBulk_args set_domain_name(String domain_name) { this.domain_name = domain_name; return this; } public void unset_domain_name() { this.domain_name = null; } /** Returns true if field domain_name is set (has been assigned a value) and false otherwise */ public boolean is_set_domain_name() { return this.domain_name != null; } public void set_domain_name_isSet(boolean value) { if (!value) { this.domain_name = null; } } public int get_keys_size() { return (this.keys == null) ? 0 : this.keys.size(); } public java.util.Iterator<ByteBuffer> get_keys_iterator() { return (this.keys == null) ? null : this.keys.iterator(); } public void add_to_keys(ByteBuffer elem) { if (this.keys == null) { this.keys = new ArrayList<ByteBuffer>(); } this.keys.add(elem); } public List<ByteBuffer> get_keys() { return this.keys; } public getBulk_args set_keys(List<ByteBuffer> keys) { this.keys = keys; return this; } public void unset_keys() { this.keys = null; } /** Returns true if field keys is set (has been assigned a value) and false otherwise */ public boolean is_set_keys() { return this.keys != null; } public void set_keys_isSet(boolean value) { if (!value) { this.keys = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case DOMAIN_NAME: if (value == null) { unset_domain_name(); } else { set_domain_name((String)value); } break; case KEYS: if (value == null) { unset_keys(); } else { set_keys((List<ByteBuffer>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DOMAIN_NAME: return get_domain_name(); case KEYS: return get_keys(); } 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 DOMAIN_NAME: return is_set_domain_name(); case KEYS: return is_set_keys(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getBulk_args) return this.equals((getBulk_args)that); return false; } public boolean equals(getBulk_args that) { if (that == null) return false; boolean this_present_domain_name = true && this.is_set_domain_name(); boolean that_present_domain_name = true && that.is_set_domain_name(); if (this_present_domain_name || that_present_domain_name) { if (!(this_present_domain_name && that_present_domain_name)) return false; if (!this.domain_name.equals(that.domain_name)) return false; } boolean this_present_keys = true && this.is_set_keys(); boolean that_present_keys = true && that.is_set_keys(); if (this_present_keys || that_present_keys) { if (!(this_present_keys && that_present_keys)) return false; if (!this.keys.equals(that.keys)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_domain_name = true && (is_set_domain_name()); builder.append(present_domain_name); if (present_domain_name) builder.append(domain_name); boolean present_keys = true && (is_set_keys()); builder.append(present_keys); if (present_keys) builder.append(keys); return builder.toHashCode(); } @Override public int compareTo(getBulk_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_domain_name()).compareTo(other.is_set_domain_name()); if (lastComparison != 0) { return lastComparison; } if (is_set_domain_name()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain_name, other.domain_name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_keys()).compareTo(other.is_set_keys()); if (lastComparison != 0) { return lastComparison; } if (is_set_keys()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, other.keys); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getBulk_args("); boolean first = true; sb.append("domain_name:"); if (this.domain_name == null) { sb.append("null"); } else { sb.append(this.domain_name); } first = false; if (!first) sb.append(", "); sb.append("keys:"); if (this.keys == null) { sb.append("null"); } else { sb.append(this.keys); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getBulk_argsStandardSchemeFactory implements SchemeFactory { public getBulk_argsStandardScheme getScheme() { return new getBulk_argsStandardScheme(); } } private static class getBulk_argsStandardScheme extends StandardScheme<getBulk_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getBulk_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // DOMAIN_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.domain_name = iprot.readString(); struct.set_domain_name_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEYS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); struct.keys = new ArrayList<ByteBuffer>(_list94.size); for (int _i95 = 0; _i95 < _list94.size; ++_i95) { ByteBuffer _elem96; // required _elem96 = iprot.readBinary(); struct.keys.add(_elem96); } iprot.readListEnd(); } struct.set_keys_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getBulk_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.domain_name != null) { oprot.writeFieldBegin(DOMAIN_NAME_FIELD_DESC); oprot.writeString(struct.domain_name); oprot.writeFieldEnd(); } if (struct.keys != null) { oprot.writeFieldBegin(KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); for (ByteBuffer _iter97 : struct.keys) { oprot.writeBinary(_iter97); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getBulk_argsTupleSchemeFactory implements SchemeFactory { public getBulk_argsTupleScheme getScheme() { return new getBulk_argsTupleScheme(); } } private static class getBulk_argsTupleScheme extends TupleScheme<getBulk_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getBulk_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.is_set_domain_name()) { optionals.set(0); } if (struct.is_set_keys()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.is_set_domain_name()) { oprot.writeString(struct.domain_name); } if (struct.is_set_keys()) { { oprot.writeI32(struct.keys.size()); for (ByteBuffer _iter98 : struct.keys) { oprot.writeBinary(_iter98); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getBulk_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.domain_name = iprot.readString(); struct.set_domain_name_isSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.keys = new ArrayList<ByteBuffer>(_list99.size); for (int _i100 = 0; _i100 < _list99.size; ++_i100) { ByteBuffer _elem101; // required _elem101 = iprot.readBinary(); struct.keys.add(_elem101); } } struct.set_keys_isSet(true); } } } } public static class getBulk_result implements org.apache.thrift.TBase<getBulk_result, getBulk_result._Fields>, java.io.Serializable, Cloneable, Comparable<getBulk_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBulk_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getBulk_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getBulk_resultTupleSchemeFactory()); } public HankBulkResponse success; // 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 { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); 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 0: // SUCCESS return SUCCESS; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HankBulkResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBulk_result.class, metaDataMap); } public getBulk_result() { } public getBulk_result( HankBulkResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getBulk_result(getBulk_result other) { if (other.is_set_success()) { this.success = new HankBulkResponse(other.success); } } public getBulk_result deepCopy() { return new getBulk_result(this); } @Override public void clear() { this.success = null; } public HankBulkResponse get_success() { return this.success; } public getBulk_result set_success(HankBulkResponse success) { this.success = success; return this; } public void unset_success() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean is_set_success() { return this.success != null; } public void set_success_isSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((HankBulkResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return get_success(); } 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 SUCCESS: return is_set_success(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getBulk_result) return this.equals((getBulk_result)that); return false; } public boolean equals(getBulk_result that) { if (that == null) return false; boolean this_present_success = true && this.is_set_success(); boolean that_present_success = true && that.is_set_success(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_success = true && (is_set_success()); builder.append(present_success); if (present_success) builder.append(success); return builder.toHashCode(); } @Override public int compareTo(getBulk_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getBulk_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getBulk_resultStandardSchemeFactory implements SchemeFactory { public getBulk_resultStandardScheme getScheme() { return new getBulk_resultStandardScheme(); } } private static class getBulk_resultStandardScheme extends StandardScheme<getBulk_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getBulk_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new HankBulkResponse(); struct.success.read(iprot); struct.set_success_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getBulk_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getBulk_resultTupleSchemeFactory implements SchemeFactory { public getBulk_resultTupleScheme getScheme() { return new getBulk_resultTupleScheme(); } } private static class getBulk_resultTupleScheme extends TupleScheme<getBulk_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getBulk_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.is_set_success()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.is_set_success()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getBulk_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new HankBulkResponse(); struct.success.read(iprot); struct.set_success_isSet(true); } } } } }