/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package ch.usi.da.dlog.thrift.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 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 PaxosLearnerService {
public interface Iface {
public Decision deliver(int timeout) throws org.apache.thrift.TException;
public Decision nb_deliver() throws org.apache.thrift.TException;
public void safe(int ring, long instance) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void deliver(int timeout, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deliver_call> resultHandler) throws org.apache.thrift.TException;
public void nb_deliver(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.nb_deliver_call> resultHandler) throws org.apache.thrift.TException;
public void safe(int ring, long instance, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.safe_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 Decision deliver(int timeout) throws org.apache.thrift.TException
{
send_deliver(timeout);
return recv_deliver();
}
public void send_deliver(int timeout) throws org.apache.thrift.TException
{
deliver_args args = new deliver_args();
args.setTimeout(timeout);
sendBase("deliver", args);
}
public Decision recv_deliver() throws org.apache.thrift.TException
{
deliver_result result = new deliver_result();
receiveBase(result, "deliver");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deliver failed: unknown result");
}
public Decision nb_deliver() throws org.apache.thrift.TException
{
send_nb_deliver();
return recv_nb_deliver();
}
public void send_nb_deliver() throws org.apache.thrift.TException
{
nb_deliver_args args = new nb_deliver_args();
sendBase("nb_deliver", args);
}
public Decision recv_nb_deliver() throws org.apache.thrift.TException
{
nb_deliver_result result = new nb_deliver_result();
receiveBase(result, "nb_deliver");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "nb_deliver failed: unknown result");
}
public void safe(int ring, long instance) throws org.apache.thrift.TException
{
send_safe(ring, instance);
recv_safe();
}
public void send_safe(int ring, long instance) throws org.apache.thrift.TException
{
safe_args args = new safe_args();
args.setRing(ring);
args.setInstance(instance);
sendBase("safe", args);
}
public void recv_safe() throws org.apache.thrift.TException
{
safe_result result = new safe_result();
receiveBase(result, "safe");
return;
}
}
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 deliver(int timeout, org.apache.thrift.async.AsyncMethodCallback<deliver_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
deliver_call method_call = new deliver_call(timeout, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class deliver_call extends org.apache.thrift.async.TAsyncMethodCall {
private int timeout;
public deliver_call(int timeout, org.apache.thrift.async.AsyncMethodCallback<deliver_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.timeout = timeout;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deliver", org.apache.thrift.protocol.TMessageType.CALL, 0));
deliver_args args = new deliver_args();
args.setTimeout(timeout);
args.write(prot);
prot.writeMessageEnd();
}
public Decision 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_deliver();
}
}
public void nb_deliver(org.apache.thrift.async.AsyncMethodCallback<nb_deliver_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
nb_deliver_call method_call = new nb_deliver_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class nb_deliver_call extends org.apache.thrift.async.TAsyncMethodCall {
public nb_deliver_call(org.apache.thrift.async.AsyncMethodCallback<nb_deliver_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);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("nb_deliver", org.apache.thrift.protocol.TMessageType.CALL, 0));
nb_deliver_args args = new nb_deliver_args();
args.write(prot);
prot.writeMessageEnd();
}
public Decision 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_nb_deliver();
}
}
public void safe(int ring, long instance, org.apache.thrift.async.AsyncMethodCallback<safe_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
safe_call method_call = new safe_call(ring, instance, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class safe_call extends org.apache.thrift.async.TAsyncMethodCall {
private int ring;
private long instance;
public safe_call(int ring, long instance, org.apache.thrift.async.AsyncMethodCallback<safe_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.ring = ring;
this.instance = instance;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("safe", org.apache.thrift.protocol.TMessageType.CALL, 0));
safe_args args = new safe_args();
args.setRing(ring);
args.setInstance(instance);
args.write(prot);
prot.writeMessageEnd();
}
public void 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);
(new Client(prot)).recv_safe();
}
}
}
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("deliver", new deliver());
processMap.put("nb_deliver", new nb_deliver());
processMap.put("safe", new safe());
return processMap;
}
public static class deliver<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deliver_args> {
public deliver() {
super("deliver");
}
public deliver_args getEmptyArgsInstance() {
return new deliver_args();
}
protected boolean isOneway() {
return false;
}
public deliver_result getResult(I iface, deliver_args args) throws org.apache.thrift.TException {
deliver_result result = new deliver_result();
result.success = iface.deliver(args.timeout);
return result;
}
}
public static class nb_deliver<I extends Iface> extends org.apache.thrift.ProcessFunction<I, nb_deliver_args> {
public nb_deliver() {
super("nb_deliver");
}
public nb_deliver_args getEmptyArgsInstance() {
return new nb_deliver_args();
}
protected boolean isOneway() {
return false;
}
public nb_deliver_result getResult(I iface, nb_deliver_args args) throws org.apache.thrift.TException {
nb_deliver_result result = new nb_deliver_result();
result.success = iface.nb_deliver();
return result;
}
}
public static class safe<I extends Iface> extends org.apache.thrift.ProcessFunction<I, safe_args> {
public safe() {
super("safe");
}
public safe_args getEmptyArgsInstance() {
return new safe_args();
}
protected boolean isOneway() {
return false;
}
public safe_result getResult(I iface, safe_args args) throws org.apache.thrift.TException {
safe_result result = new safe_result();
iface.safe(args.ring, args.instance);
return result;
}
}
}
public static class deliver_args implements org.apache.thrift.TBase<deliver_args, deliver_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deliver_args");
private static final org.apache.thrift.protocol.TField TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("timeout", org.apache.thrift.protocol.TType.I32, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new deliver_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new deliver_argsTupleSchemeFactory());
}
public int timeout; // 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 {
TIMEOUT((short)1, "timeout");
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: // TIMEOUT
return TIMEOUT;
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 __TIMEOUT_ISSET_ID = 0;
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.TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("timeout", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deliver_args.class, metaDataMap);
}
public deliver_args() {
}
public deliver_args(
int timeout)
{
this();
this.timeout = timeout;
setTimeoutIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deliver_args(deliver_args other) {
__isset_bitfield = other.__isset_bitfield;
this.timeout = other.timeout;
}
public deliver_args deepCopy() {
return new deliver_args(this);
}
@Override
public void clear() {
setTimeoutIsSet(false);
this.timeout = 0;
}
public int getTimeout() {
return this.timeout;
}
public deliver_args setTimeout(int timeout) {
this.timeout = timeout;
setTimeoutIsSet(true);
return this;
}
public void unsetTimeout() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOUT_ISSET_ID);
}
/** Returns true if field timeout is set (has been assigned a value) and false otherwise */
public boolean isSetTimeout() {
return EncodingUtils.testBit(__isset_bitfield, __TIMEOUT_ISSET_ID);
}
public void setTimeoutIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOUT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TIMEOUT:
if (value == null) {
unsetTimeout();
} else {
setTimeout((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TIMEOUT:
return Integer.valueOf(getTimeout());
}
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 TIMEOUT:
return isSetTimeout();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof deliver_args)
return this.equals((deliver_args)that);
return false;
}
public boolean equals(deliver_args that) {
if (that == null)
return false;
boolean this_present_timeout = true;
boolean that_present_timeout = true;
if (this_present_timeout || that_present_timeout) {
if (!(this_present_timeout && that_present_timeout))
return false;
if (this.timeout != that.timeout)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(deliver_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
deliver_args typedOther = (deliver_args)other;
lastComparison = Boolean.valueOf(isSetTimeout()).compareTo(typedOther.isSetTimeout());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTimeout()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeout, typedOther.timeout);
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("deliver_args(");
boolean first = true;
sb.append("timeout:");
sb.append(this.timeout);
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 {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
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 deliver_argsStandardSchemeFactory implements SchemeFactory {
public deliver_argsStandardScheme getScheme() {
return new deliver_argsStandardScheme();
}
}
private static class deliver_argsStandardScheme extends StandardScheme<deliver_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deliver_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: // TIMEOUT
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.timeout = iprot.readI32();
struct.setTimeoutIsSet(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, deliver_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(TIMEOUT_FIELD_DESC);
oprot.writeI32(struct.timeout);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deliver_argsTupleSchemeFactory implements SchemeFactory {
public deliver_argsTupleScheme getScheme() {
return new deliver_argsTupleScheme();
}
}
private static class deliver_argsTupleScheme extends TupleScheme<deliver_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deliver_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetTimeout()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetTimeout()) {
oprot.writeI32(struct.timeout);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deliver_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.timeout = iprot.readI32();
struct.setTimeoutIsSet(true);
}
}
}
}
public static class deliver_result implements org.apache.thrift.TBase<deliver_result, deliver_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deliver_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 deliver_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new deliver_resultTupleSchemeFactory());
}
public Decision 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, Decision.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deliver_result.class, metaDataMap);
}
public deliver_result() {
}
public deliver_result(
Decision success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deliver_result(deliver_result other) {
if (other.isSetSuccess()) {
this.success = new Decision(other.success);
}
}
public deliver_result deepCopy() {
return new deliver_result(this);
}
@Override
public void clear() {
this.success = null;
}
public Decision getSuccess() {
return this.success;
}
public deliver_result setSuccess(Decision success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Decision)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
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 isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof deliver_result)
return this.equals((deliver_result)that);
return false;
}
public boolean equals(deliver_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
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() {
return 0;
}
public int compareTo(deliver_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
deliver_result typedOther = (deliver_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.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("deliver_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
if (success != null) {
success.validate();
}
}
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 deliver_resultStandardSchemeFactory implements SchemeFactory {
public deliver_resultStandardScheme getScheme() {
return new deliver_resultStandardScheme();
}
}
private static class deliver_resultStandardScheme extends StandardScheme<deliver_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deliver_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 Decision();
struct.success.read(iprot);
struct.setSuccessIsSet(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, deliver_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 deliver_resultTupleSchemeFactory implements SchemeFactory {
public deliver_resultTupleScheme getScheme() {
return new deliver_resultTupleScheme();
}
}
private static class deliver_resultTupleScheme extends TupleScheme<deliver_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deliver_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deliver_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new Decision();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class nb_deliver_args implements org.apache.thrift.TBase<nb_deliver_args, nb_deliver_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("nb_deliver_args");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new nb_deliver_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new nb_deliver_argsTupleSchemeFactory());
}
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
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) {
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;
}
}
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);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(nb_deliver_args.class, metaDataMap);
}
public nb_deliver_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public nb_deliver_args(nb_deliver_args other) {
}
public nb_deliver_args deepCopy() {
return new nb_deliver_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
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) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof nb_deliver_args)
return this.equals((nb_deliver_args)that);
return false;
}
public boolean equals(nb_deliver_args that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(nb_deliver_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
nb_deliver_args typedOther = (nb_deliver_args)other;
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("nb_deliver_args(");
boolean first = true;
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 nb_deliver_argsStandardSchemeFactory implements SchemeFactory {
public nb_deliver_argsStandardScheme getScheme() {
return new nb_deliver_argsStandardScheme();
}
}
private static class nb_deliver_argsStandardScheme extends StandardScheme<nb_deliver_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, nb_deliver_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) {
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, nb_deliver_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class nb_deliver_argsTupleSchemeFactory implements SchemeFactory {
public nb_deliver_argsTupleScheme getScheme() {
return new nb_deliver_argsTupleScheme();
}
}
private static class nb_deliver_argsTupleScheme extends TupleScheme<nb_deliver_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, nb_deliver_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, nb_deliver_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
public static class nb_deliver_result implements org.apache.thrift.TBase<nb_deliver_result, nb_deliver_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("nb_deliver_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 nb_deliver_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new nb_deliver_resultTupleSchemeFactory());
}
public Decision 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, Decision.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(nb_deliver_result.class, metaDataMap);
}
public nb_deliver_result() {
}
public nb_deliver_result(
Decision success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public nb_deliver_result(nb_deliver_result other) {
if (other.isSetSuccess()) {
this.success = new Decision(other.success);
}
}
public nb_deliver_result deepCopy() {
return new nb_deliver_result(this);
}
@Override
public void clear() {
this.success = null;
}
public Decision getSuccess() {
return this.success;
}
public nb_deliver_result setSuccess(Decision success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Decision)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
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 isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof nb_deliver_result)
return this.equals((nb_deliver_result)that);
return false;
}
public boolean equals(nb_deliver_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
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() {
return 0;
}
public int compareTo(nb_deliver_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
nb_deliver_result typedOther = (nb_deliver_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.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("nb_deliver_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
if (success != null) {
success.validate();
}
}
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 nb_deliver_resultStandardSchemeFactory implements SchemeFactory {
public nb_deliver_resultStandardScheme getScheme() {
return new nb_deliver_resultStandardScheme();
}
}
private static class nb_deliver_resultStandardScheme extends StandardScheme<nb_deliver_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, nb_deliver_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 Decision();
struct.success.read(iprot);
struct.setSuccessIsSet(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, nb_deliver_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 nb_deliver_resultTupleSchemeFactory implements SchemeFactory {
public nb_deliver_resultTupleScheme getScheme() {
return new nb_deliver_resultTupleScheme();
}
}
private static class nb_deliver_resultTupleScheme extends TupleScheme<nb_deliver_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, nb_deliver_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, nb_deliver_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new Decision();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class safe_args implements org.apache.thrift.TBase<safe_args, safe_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("safe_args");
private static final org.apache.thrift.protocol.TField RING_FIELD_DESC = new org.apache.thrift.protocol.TField("ring", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField INSTANCE_FIELD_DESC = new org.apache.thrift.protocol.TField("instance", org.apache.thrift.protocol.TType.I64, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new safe_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new safe_argsTupleSchemeFactory());
}
public int ring; // required
public long instance; // 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 {
RING((short)1, "ring"),
INSTANCE((short)2, "instance");
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: // RING
return RING;
case 2: // INSTANCE
return INSTANCE;
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 __RING_ISSET_ID = 0;
private static final int __INSTANCE_ISSET_ID = 1;
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.RING, new org.apache.thrift.meta_data.FieldMetaData("ring", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.INSTANCE, new org.apache.thrift.meta_data.FieldMetaData("instance", 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(safe_args.class, metaDataMap);
}
public safe_args() {
}
public safe_args(
int ring,
long instance)
{
this();
this.ring = ring;
setRingIsSet(true);
this.instance = instance;
setInstanceIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public safe_args(safe_args other) {
__isset_bitfield = other.__isset_bitfield;
this.ring = other.ring;
this.instance = other.instance;
}
public safe_args deepCopy() {
return new safe_args(this);
}
@Override
public void clear() {
setRingIsSet(false);
this.ring = 0;
setInstanceIsSet(false);
this.instance = 0;
}
public int getRing() {
return this.ring;
}
public safe_args setRing(int ring) {
this.ring = ring;
setRingIsSet(true);
return this;
}
public void unsetRing() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RING_ISSET_ID);
}
/** Returns true if field ring is set (has been assigned a value) and false otherwise */
public boolean isSetRing() {
return EncodingUtils.testBit(__isset_bitfield, __RING_ISSET_ID);
}
public void setRingIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RING_ISSET_ID, value);
}
public long getInstance() {
return this.instance;
}
public safe_args setInstance(long instance) {
this.instance = instance;
setInstanceIsSet(true);
return this;
}
public void unsetInstance() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INSTANCE_ISSET_ID);
}
/** Returns true if field instance is set (has been assigned a value) and false otherwise */
public boolean isSetInstance() {
return EncodingUtils.testBit(__isset_bitfield, __INSTANCE_ISSET_ID);
}
public void setInstanceIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INSTANCE_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case RING:
if (value == null) {
unsetRing();
} else {
setRing((Integer)value);
}
break;
case INSTANCE:
if (value == null) {
unsetInstance();
} else {
setInstance((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case RING:
return Integer.valueOf(getRing());
case INSTANCE:
return Long.valueOf(getInstance());
}
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 RING:
return isSetRing();
case INSTANCE:
return isSetInstance();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof safe_args)
return this.equals((safe_args)that);
return false;
}
public boolean equals(safe_args that) {
if (that == null)
return false;
boolean this_present_ring = true;
boolean that_present_ring = true;
if (this_present_ring || that_present_ring) {
if (!(this_present_ring && that_present_ring))
return false;
if (this.ring != that.ring)
return false;
}
boolean this_present_instance = true;
boolean that_present_instance = true;
if (this_present_instance || that_present_instance) {
if (!(this_present_instance && that_present_instance))
return false;
if (this.instance != that.instance)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(safe_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
safe_args typedOther = (safe_args)other;
lastComparison = Boolean.valueOf(isSetRing()).compareTo(typedOther.isSetRing());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRing()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ring, typedOther.ring);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetInstance()).compareTo(typedOther.isSetInstance());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInstance()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instance, typedOther.instance);
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("safe_args(");
boolean first = true;
sb.append("ring:");
sb.append(this.ring);
first = false;
if (!first) sb.append(", ");
sb.append("instance:");
sb.append(this.instance);
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 {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
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 safe_argsStandardSchemeFactory implements SchemeFactory {
public safe_argsStandardScheme getScheme() {
return new safe_argsStandardScheme();
}
}
private static class safe_argsStandardScheme extends StandardScheme<safe_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, safe_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: // RING
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.ring = iprot.readI32();
struct.setRingIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // INSTANCE
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.instance = iprot.readI64();
struct.setInstanceIsSet(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, safe_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(RING_FIELD_DESC);
oprot.writeI32(struct.ring);
oprot.writeFieldEnd();
oprot.writeFieldBegin(INSTANCE_FIELD_DESC);
oprot.writeI64(struct.instance);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class safe_argsTupleSchemeFactory implements SchemeFactory {
public safe_argsTupleScheme getScheme() {
return new safe_argsTupleScheme();
}
}
private static class safe_argsTupleScheme extends TupleScheme<safe_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, safe_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetRing()) {
optionals.set(0);
}
if (struct.isSetInstance()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetRing()) {
oprot.writeI32(struct.ring);
}
if (struct.isSetInstance()) {
oprot.writeI64(struct.instance);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, safe_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.ring = iprot.readI32();
struct.setRingIsSet(true);
}
if (incoming.get(1)) {
struct.instance = iprot.readI64();
struct.setInstanceIsSet(true);
}
}
}
}
public static class safe_result implements org.apache.thrift.TBase<safe_result, safe_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("safe_result");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new safe_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new safe_resultTupleSchemeFactory());
}
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
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) {
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;
}
}
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);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(safe_result.class, metaDataMap);
}
public safe_result() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public safe_result(safe_result other) {
}
public safe_result deepCopy() {
return new safe_result(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
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) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof safe_result)
return this.equals((safe_result)that);
return false;
}
public boolean equals(safe_result that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(safe_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
safe_result typedOther = (safe_result)other;
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("safe_result(");
boolean first = true;
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 safe_resultStandardSchemeFactory implements SchemeFactory {
public safe_resultStandardScheme getScheme() {
return new safe_resultStandardScheme();
}
}
private static class safe_resultStandardScheme extends StandardScheme<safe_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, safe_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) {
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, safe_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class safe_resultTupleSchemeFactory implements SchemeFactory {
public safe_resultTupleScheme getScheme() {
return new safe_resultTupleScheme();
}
}
private static class safe_resultTupleScheme extends TupleScheme<safe_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, safe_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, safe_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
}