Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.thriftee.examples.usergroup.service.GroupService Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (1.0.0-dev)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.thriftee.examples.usergroup.service;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2016-02-10")
public class GroupService {
public interface Iface {
public boolean addUserToGroup(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1) throws UserGroupException, org.apache.thrift.TException;
public org.thriftee.examples.usergroup.domain.Group find(String arg0) throws UserGroupException, org.apache.thrift.TException;
public List groupNames(org.thriftee.examples.usergroup.domain.User arg0) throws UserGroupException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void addUserToGroup(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void find(String arg0, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void groupNames(org.thriftee.examples.usergroup.domain.User arg0, org.apache.thrift.async.AsyncMethodCallback 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 {
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 boolean addUserToGroup(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1) throws UserGroupException, org.apache.thrift.TException
{
send_addUserToGroup(arg0, arg1);
return recv_addUserToGroup();
}
public void send_addUserToGroup(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1) throws org.apache.thrift.TException
{
addUserToGroup_args args = new addUserToGroup_args();
args.setArg0(arg0);
args.setArg1(arg1);
sendBase("addUserToGroup", args);
}
public boolean recv_addUserToGroup() throws UserGroupException, org.apache.thrift.TException
{
addUserToGroup_result result = new addUserToGroup_result();
receiveBase(result, "addUserToGroup");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ex1 != null) {
throw result.ex1;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addUserToGroup failed: unknown result");
}
public org.thriftee.examples.usergroup.domain.Group find(String arg0) throws UserGroupException, org.apache.thrift.TException
{
send_find(arg0);
return recv_find();
}
public void send_find(String arg0) throws org.apache.thrift.TException
{
find_args args = new find_args();
args.setArg0(arg0);
sendBase("find", args);
}
public org.thriftee.examples.usergroup.domain.Group recv_find() throws UserGroupException, org.apache.thrift.TException
{
find_result result = new find_result();
receiveBase(result, "find");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ex1 != null) {
throw result.ex1;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "find failed: unknown result");
}
public List groupNames(org.thriftee.examples.usergroup.domain.User arg0) throws UserGroupException, org.apache.thrift.TException
{
send_groupNames(arg0);
return recv_groupNames();
}
public void send_groupNames(org.thriftee.examples.usergroup.domain.User arg0) throws org.apache.thrift.TException
{
groupNames_args args = new groupNames_args();
args.setArg0(arg0);
sendBase("groupNames", args);
}
public List recv_groupNames() throws UserGroupException, org.apache.thrift.TException
{
groupNames_result result = new groupNames_result();
receiveBase(result, "groupNames");
if (result.isSetSuccess()) {
return result.success;
}
if (result.ex1 != null) {
throw result.ex1;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "groupNames 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 {
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 addUserToGroup(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
addUserToGroup_call method_call = new addUserToGroup_call(arg0, arg1, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class addUserToGroup_call extends org.apache.thrift.async.TAsyncMethodCall {
private org.thriftee.examples.usergroup.domain.Group arg0;
private org.thriftee.examples.usergroup.domain.User arg1;
public addUserToGroup_call(org.thriftee.examples.usergroup.domain.Group arg0, org.thriftee.examples.usergroup.domain.User arg1, org.apache.thrift.async.AsyncMethodCallback 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.arg0 = arg0;
this.arg1 = arg1;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addUserToGroup", org.apache.thrift.protocol.TMessageType.CALL, 0));
addUserToGroup_args args = new addUserToGroup_args();
args.setArg0(arg0);
args.setArg1(arg1);
args.write(prot);
prot.writeMessageEnd();
}
public boolean getResult() throws UserGroupException, 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_addUserToGroup();
}
}
public void find(String arg0, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
find_call method_call = new find_call(arg0, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class find_call extends org.apache.thrift.async.TAsyncMethodCall {
private String arg0;
public find_call(String arg0, org.apache.thrift.async.AsyncMethodCallback 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.arg0 = arg0;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("find", org.apache.thrift.protocol.TMessageType.CALL, 0));
find_args args = new find_args();
args.setArg0(arg0);
args.write(prot);
prot.writeMessageEnd();
}
public org.thriftee.examples.usergroup.domain.Group getResult() throws UserGroupException, 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_find();
}
}
public void groupNames(org.thriftee.examples.usergroup.domain.User arg0, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
groupNames_call method_call = new groupNames_call(arg0, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class groupNames_call extends org.apache.thrift.async.TAsyncMethodCall {
private org.thriftee.examples.usergroup.domain.User arg0;
public groupNames_call(org.thriftee.examples.usergroup.domain.User arg0, org.apache.thrift.async.AsyncMethodCallback 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.arg0 = arg0;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("groupNames", org.apache.thrift.protocol.TMessageType.CALL, 0));
groupNames_args args = new groupNames_args();
args.setArg0(arg0);
args.write(prot);
prot.writeMessageEnd();
}
public List getResult() throws UserGroupException, 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_groupNames();
}
}
}
public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected Processor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("addUserToGroup", new addUserToGroup());
processMap.put("find", new find());
processMap.put("groupNames", new groupNames());
return processMap;
}
public static class addUserToGroup extends org.apache.thrift.ProcessFunction {
public addUserToGroup() {
super("addUserToGroup");
}
public addUserToGroup_args getEmptyArgsInstance() {
return new addUserToGroup_args();
}
protected boolean isOneway() {
return false;
}
public addUserToGroup_result getResult(I iface, addUserToGroup_args args) throws org.apache.thrift.TException {
addUserToGroup_result result = new addUserToGroup_result();
try {
result.success = iface.addUserToGroup(args.arg0, args.arg1);
result.setSuccessIsSet(true);
} catch (UserGroupException ex1) {
result.ex1 = ex1;
}
return result;
}
}
public static class find extends org.apache.thrift.ProcessFunction {
public find() {
super("find");
}
public find_args getEmptyArgsInstance() {
return new find_args();
}
protected boolean isOneway() {
return false;
}
public find_result getResult(I iface, find_args args) throws org.apache.thrift.TException {
find_result result = new find_result();
try {
result.success = iface.find(args.arg0);
} catch (UserGroupException ex1) {
result.ex1 = ex1;
}
return result;
}
}
public static class groupNames extends org.apache.thrift.ProcessFunction {
public groupNames() {
super("groupNames");
}
public groupNames_args getEmptyArgsInstance() {
return new groupNames_args();
}
protected boolean isOneway() {
return false;
}
public groupNames_result getResult(I iface, groupNames_args args) throws org.apache.thrift.TException {
groupNames_result result = new groupNames_result();
try {
result.success = iface.groupNames(args.arg0);
} catch (UserGroupException ex1) {
result.ex1 = ex1;
}
return result;
}
}
}
public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected AsyncProcessor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("addUserToGroup", new addUserToGroup());
processMap.put("find", new find());
processMap.put("groupNames", new groupNames());
return processMap;
}
public static class addUserToGroup extends org.apache.thrift.AsyncProcessFunction {
public addUserToGroup() {
super("addUserToGroup");
}
public addUserToGroup_args getEmptyArgsInstance() {
return new addUserToGroup_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Boolean o) {
addUserToGroup_result result = new addUserToGroup_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
addUserToGroup_result result = new addUserToGroup_result();
if (e instanceof UserGroupException) {
result.ex1 = (UserGroupException) e;
result.setEx1IsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, addUserToGroup_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.addUserToGroup(args.arg0, args.arg1,resultHandler);
}
}
public static class find extends org.apache.thrift.AsyncProcessFunction {
public find() {
super("find");
}
public find_args getEmptyArgsInstance() {
return new find_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(org.thriftee.examples.usergroup.domain.Group o) {
find_result result = new find_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
find_result result = new find_result();
if (e instanceof UserGroupException) {
result.ex1 = (UserGroupException) e;
result.setEx1IsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, find_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.find(args.arg0,resultHandler);
}
}
public static class groupNames extends org.apache.thrift.AsyncProcessFunction> {
public groupNames() {
super("groupNames");
}
public groupNames_args getEmptyArgsInstance() {
return new groupNames_args();
}
public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback>() {
public void onComplete(List o) {
groupNames_result result = new groupNames_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
groupNames_result result = new groupNames_result();
if (e instanceof UserGroupException) {
result.ex1 = (UserGroupException) e;
result.setEx1IsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, groupNames_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
iface.groupNames(args.arg0,resultHandler);
}
}
}
public static class addUserToGroup_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addUserToGroup_args");
private static final org.apache.thrift.protocol.TField ARG0_FIELD_DESC = new org.apache.thrift.protocol.TField("arg0", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField ARG1_FIELD_DESC = new org.apache.thrift.protocol.TField("arg1", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new addUserToGroup_argsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new addUserToGroup_argsTupleSchemeFactory();
public org.thriftee.examples.usergroup.domain.Group arg0; // required
public org.thriftee.examples.usergroup.domain.User arg1; // 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 {
ARG0((short)1, "arg0"),
ARG1((short)2, "arg1");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG0
return ARG0;
case 2: // ARG1
return ARG1;
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.ARG0, new org.apache.thrift.meta_data.FieldMetaData("arg0", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.thriftee.examples.usergroup.domain.Group.class)));
tmpMap.put(_Fields.ARG1, new org.apache.thrift.meta_data.FieldMetaData("arg1", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.thriftee.examples.usergroup.domain.User.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addUserToGroup_args.class, metaDataMap);
}
public addUserToGroup_args() {
}
public addUserToGroup_args(
org.thriftee.examples.usergroup.domain.Group arg0,
org.thriftee.examples.usergroup.domain.User arg1)
{
this();
this.arg0 = arg0;
this.arg1 = arg1;
}
/**
* Performs a deep copy on other .
*/
public addUserToGroup_args(addUserToGroup_args other) {
if (other.isSetArg0()) {
this.arg0 = new org.thriftee.examples.usergroup.domain.Group(other.arg0);
}
if (other.isSetArg1()) {
this.arg1 = new org.thriftee.examples.usergroup.domain.User(other.arg1);
}
}
public addUserToGroup_args deepCopy() {
return new addUserToGroup_args(this);
}
@Override
public void clear() {
this.arg0 = null;
this.arg1 = null;
}
public org.thriftee.examples.usergroup.domain.Group getArg0() {
return this.arg0;
}
public addUserToGroup_args setArg0(org.thriftee.examples.usergroup.domain.Group arg0) {
this.arg0 = arg0;
return this;
}
public void unsetArg0() {
this.arg0 = null;
}
/** Returns true if field arg0 is set (has been assigned a value) and false otherwise */
public boolean isSetArg0() {
return this.arg0 != null;
}
public void setArg0IsSet(boolean value) {
if (!value) {
this.arg0 = null;
}
}
public org.thriftee.examples.usergroup.domain.User getArg1() {
return this.arg1;
}
public addUserToGroup_args setArg1(org.thriftee.examples.usergroup.domain.User arg1) {
this.arg1 = arg1;
return this;
}
public void unsetArg1() {
this.arg1 = null;
}
/** Returns true if field arg1 is set (has been assigned a value) and false otherwise */
public boolean isSetArg1() {
return this.arg1 != null;
}
public void setArg1IsSet(boolean value) {
if (!value) {
this.arg1 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ARG0:
if (value == null) {
unsetArg0();
} else {
setArg0((org.thriftee.examples.usergroup.domain.Group)value);
}
break;
case ARG1:
if (value == null) {
unsetArg1();
} else {
setArg1((org.thriftee.examples.usergroup.domain.User)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ARG0:
return getArg0();
case ARG1:
return getArg1();
}
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 ARG0:
return isSetArg0();
case ARG1:
return isSetArg1();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof addUserToGroup_args)
return this.equals((addUserToGroup_args)that);
return false;
}
public boolean equals(addUserToGroup_args that) {
if (that == null)
return false;
boolean this_present_arg0 = true && this.isSetArg0();
boolean that_present_arg0 = true && that.isSetArg0();
if (this_present_arg0 || that_present_arg0) {
if (!(this_present_arg0 && that_present_arg0))
return false;
if (!this.arg0.equals(that.arg0))
return false;
}
boolean this_present_arg1 = true && this.isSetArg1();
boolean that_present_arg1 = true && that.isSetArg1();
if (this_present_arg1 || that_present_arg1) {
if (!(this_present_arg1 && that_present_arg1))
return false;
if (!this.arg1.equals(that.arg1))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_arg0 = true && (isSetArg0());
list.add(present_arg0);
if (present_arg0)
list.add(arg0);
boolean present_arg1 = true && (isSetArg1());
list.add(present_arg1);
if (present_arg1)
list.add(arg1);
return list.hashCode();
}
@Override
public int compareTo(addUserToGroup_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetArg0()).compareTo(other.isSetArg0());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg0()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg0, other.arg0);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetArg1()).compareTo(other.isSetArg1());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg1()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg1, other.arg1);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("addUserToGroup_args(");
boolean first = true;
sb.append("arg0:");
if (this.arg0 == null) {
sb.append("null");
} else {
sb.append(this.arg0);
}
first = false;
if (!first) sb.append(", ");
sb.append("arg1:");
if (this.arg1 == null) {
sb.append("null");
} else {
sb.append(this.arg1);
}
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 (arg0 != null) {
arg0.validate();
}
if (arg1 != null) {
arg1.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 addUserToGroup_argsStandardSchemeFactory implements SchemeFactory {
public addUserToGroup_argsStandardScheme getScheme() {
return new addUserToGroup_argsStandardScheme();
}
}
private static class addUserToGroup_argsStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, addUserToGroup_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: // ARG0
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.arg0 = new org.thriftee.examples.usergroup.domain.Group();
struct.arg0.read(iprot);
struct.setArg0IsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // ARG1
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.arg1 = new org.thriftee.examples.usergroup.domain.User();
struct.arg1.read(iprot);
struct.setArg1IsSet(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, addUserToGroup_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.arg0 != null) {
oprot.writeFieldBegin(ARG0_FIELD_DESC);
struct.arg0.write(oprot);
oprot.writeFieldEnd();
}
if (struct.arg1 != null) {
oprot.writeFieldBegin(ARG1_FIELD_DESC);
struct.arg1.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class addUserToGroup_argsTupleSchemeFactory implements SchemeFactory {
public addUserToGroup_argsTupleScheme getScheme() {
return new addUserToGroup_argsTupleScheme();
}
}
private static class addUserToGroup_argsTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, addUserToGroup_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetArg0()) {
optionals.set(0);
}
if (struct.isSetArg1()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetArg0()) {
struct.arg0.write(oprot);
}
if (struct.isSetArg1()) {
struct.arg1.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addUserToGroup_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.arg0 = new org.thriftee.examples.usergroup.domain.Group();
struct.arg0.read(iprot);
struct.setArg0IsSet(true);
}
if (incoming.get(1)) {
struct.arg1 = new org.thriftee.examples.usergroup.domain.User();
struct.arg1.read(iprot);
struct.setArg1IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class addUserToGroup_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addUserToGroup_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new addUserToGroup_resultStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new addUserToGroup_resultTupleSchemeFactory();
public boolean success; // required
public UserGroupException ex1; // 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"),
EX1((short)1, "ex1");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // EX1
return EX1;
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 __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserGroupException.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addUserToGroup_result.class, metaDataMap);
}
public addUserToGroup_result() {
}
public addUserToGroup_result(
boolean success,
UserGroupException ex1)
{
this();
this.success = success;
setSuccessIsSet(true);
this.ex1 = ex1;
}
/**
* Performs a deep copy on other .
*/
public addUserToGroup_result(addUserToGroup_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
if (other.isSetEx1()) {
this.ex1 = new UserGroupException(other.ex1);
}
}
public addUserToGroup_result deepCopy() {
return new addUserToGroup_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
this.ex1 = null;
}
public boolean isSuccess() {
return this.success;
}
public addUserToGroup_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public UserGroupException getEx1() {
return this.ex1;
}
public addUserToGroup_result setEx1(UserGroupException ex1) {
this.ex1 = ex1;
return this;
}
public void unsetEx1() {
this.ex1 = null;
}
/** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
public boolean isSetEx1() {
return this.ex1 != null;
}
public void setEx1IsSet(boolean value) {
if (!value) {
this.ex1 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Boolean)value);
}
break;
case EX1:
if (value == null) {
unsetEx1();
} else {
setEx1((UserGroupException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
case EX1:
return getEx1();
}
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();
case EX1:
return isSetEx1();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof addUserToGroup_result)
return this.equals((addUserToGroup_result)that);
return false;
}
public boolean equals(addUserToGroup_result that) {
if (that == null)
return false;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
boolean this_present_ex1 = true && this.isSetEx1();
boolean that_present_ex1 = true && that.isSetEx1();
if (this_present_ex1 || that_present_ex1) {
if (!(this_present_ex1 && that_present_ex1))
return false;
if (!this.ex1.equals(that.ex1))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_success = true;
list.add(present_success);
if (present_success)
list.add(success);
boolean present_ex1 = true && (isSetEx1());
list.add(present_ex1);
if (present_ex1)
list.add(ex1);
return list.hashCode();
}
@Override
public int compareTo(addUserToGroup_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEx1()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("addUserToGroup_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
if (!first) sb.append(", ");
sb.append("ex1:");
if (this.ex1 == null) {
sb.append("null");
} else {
sb.append(this.ex1);
}
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 addUserToGroup_resultStandardSchemeFactory implements SchemeFactory {
public addUserToGroup_resultStandardScheme getScheme() {
return new addUserToGroup_resultStandardScheme();
}
}
private static class addUserToGroup_resultStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, addUserToGroup_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.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // EX1
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(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, addUserToGroup_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
if (struct.ex1 != null) {
oprot.writeFieldBegin(EX1_FIELD_DESC);
struct.ex1.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class addUserToGroup_resultTupleSchemeFactory implements SchemeFactory {
public addUserToGroup_resultTupleScheme getScheme() {
return new addUserToGroup_resultTupleScheme();
}
}
private static class addUserToGroup_resultTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, addUserToGroup_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetEx1()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
if (struct.isSetEx1()) {
struct.ex1.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addUserToGroup_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class find_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("find_args");
private static final org.apache.thrift.protocol.TField ARG0_FIELD_DESC = new org.apache.thrift.protocol.TField("arg0", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new find_argsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new find_argsTupleSchemeFactory();
public String arg0; // 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 {
ARG0((short)1, "arg0");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG0
return ARG0;
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.ARG0, new org.apache.thrift.meta_data.FieldMetaData("arg0", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(find_args.class, metaDataMap);
}
public find_args() {
}
public find_args(
String arg0)
{
this();
this.arg0 = arg0;
}
/**
* Performs a deep copy on other .
*/
public find_args(find_args other) {
if (other.isSetArg0()) {
this.arg0 = other.arg0;
}
}
public find_args deepCopy() {
return new find_args(this);
}
@Override
public void clear() {
this.arg0 = null;
}
public String getArg0() {
return this.arg0;
}
public find_args setArg0(String arg0) {
this.arg0 = arg0;
return this;
}
public void unsetArg0() {
this.arg0 = null;
}
/** Returns true if field arg0 is set (has been assigned a value) and false otherwise */
public boolean isSetArg0() {
return this.arg0 != null;
}
public void setArg0IsSet(boolean value) {
if (!value) {
this.arg0 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ARG0:
if (value == null) {
unsetArg0();
} else {
setArg0((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ARG0:
return getArg0();
}
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 ARG0:
return isSetArg0();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof find_args)
return this.equals((find_args)that);
return false;
}
public boolean equals(find_args that) {
if (that == null)
return false;
boolean this_present_arg0 = true && this.isSetArg0();
boolean that_present_arg0 = true && that.isSetArg0();
if (this_present_arg0 || that_present_arg0) {
if (!(this_present_arg0 && that_present_arg0))
return false;
if (!this.arg0.equals(that.arg0))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_arg0 = true && (isSetArg0());
list.add(present_arg0);
if (present_arg0)
list.add(arg0);
return list.hashCode();
}
@Override
public int compareTo(find_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetArg0()).compareTo(other.isSetArg0());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg0()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg0, other.arg0);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("find_args(");
boolean first = true;
sb.append("arg0:");
if (this.arg0 == null) {
sb.append("null");
} else {
sb.append(this.arg0);
}
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 find_argsStandardSchemeFactory implements SchemeFactory {
public find_argsStandardScheme getScheme() {
return new find_argsStandardScheme();
}
}
private static class find_argsStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, find_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: // ARG0
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.arg0 = iprot.readString();
struct.setArg0IsSet(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, find_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.arg0 != null) {
oprot.writeFieldBegin(ARG0_FIELD_DESC);
oprot.writeString(struct.arg0);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class find_argsTupleSchemeFactory implements SchemeFactory {
public find_argsTupleScheme getScheme() {
return new find_argsTupleScheme();
}
}
private static class find_argsTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, find_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetArg0()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetArg0()) {
oprot.writeString(struct.arg0);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, find_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.arg0 = iprot.readString();
struct.setArg0IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class find_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("find_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 org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new find_resultStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new find_resultTupleSchemeFactory();
public org.thriftee.examples.usergroup.domain.Group success; // required
public UserGroupException ex1; // 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"),
EX1((short)1, "ex1");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // EX1
return EX1;
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, org.thriftee.examples.usergroup.domain.Group.class)));
tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserGroupException.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(find_result.class, metaDataMap);
}
public find_result() {
}
public find_result(
org.thriftee.examples.usergroup.domain.Group success,
UserGroupException ex1)
{
this();
this.success = success;
this.ex1 = ex1;
}
/**
* Performs a deep copy on other .
*/
public find_result(find_result other) {
if (other.isSetSuccess()) {
this.success = new org.thriftee.examples.usergroup.domain.Group(other.success);
}
if (other.isSetEx1()) {
this.ex1 = new UserGroupException(other.ex1);
}
}
public find_result deepCopy() {
return new find_result(this);
}
@Override
public void clear() {
this.success = null;
this.ex1 = null;
}
public org.thriftee.examples.usergroup.domain.Group getSuccess() {
return this.success;
}
public find_result setSuccess(org.thriftee.examples.usergroup.domain.Group 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 UserGroupException getEx1() {
return this.ex1;
}
public find_result setEx1(UserGroupException ex1) {
this.ex1 = ex1;
return this;
}
public void unsetEx1() {
this.ex1 = null;
}
/** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
public boolean isSetEx1() {
return this.ex1 != null;
}
public void setEx1IsSet(boolean value) {
if (!value) {
this.ex1 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((org.thriftee.examples.usergroup.domain.Group)value);
}
break;
case EX1:
if (value == null) {
unsetEx1();
} else {
setEx1((UserGroupException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case EX1:
return getEx1();
}
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();
case EX1:
return isSetEx1();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof find_result)
return this.equals((find_result)that);
return false;
}
public boolean equals(find_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;
}
boolean this_present_ex1 = true && this.isSetEx1();
boolean that_present_ex1 = true && that.isSetEx1();
if (this_present_ex1 || that_present_ex1) {
if (!(this_present_ex1 && that_present_ex1))
return false;
if (!this.ex1.equals(that.ex1))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_ex1 = true && (isSetEx1());
list.add(present_ex1);
if (present_ex1)
list.add(ex1);
return list.hashCode();
}
@Override
public int compareTo(find_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEx1()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("find_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("ex1:");
if (this.ex1 == null) {
sb.append("null");
} else {
sb.append(this.ex1);
}
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 find_resultStandardSchemeFactory implements SchemeFactory {
public find_resultStandardScheme getScheme() {
return new find_resultStandardScheme();
}
}
private static class find_resultStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, find_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 org.thriftee.examples.usergroup.domain.Group();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // EX1
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(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, find_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();
}
if (struct.ex1 != null) {
oprot.writeFieldBegin(EX1_FIELD_DESC);
struct.ex1.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class find_resultTupleSchemeFactory implements SchemeFactory {
public find_resultTupleScheme getScheme() {
return new find_resultTupleScheme();
}
}
private static class find_resultTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, find_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetEx1()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetEx1()) {
struct.ex1.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, find_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new org.thriftee.examples.usergroup.domain.Group();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class groupNames_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("groupNames_args");
private static final org.apache.thrift.protocol.TField ARG0_FIELD_DESC = new org.apache.thrift.protocol.TField("arg0", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new groupNames_argsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new groupNames_argsTupleSchemeFactory();
public org.thriftee.examples.usergroup.domain.User arg0; // 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 {
ARG0((short)1, "arg0");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG0
return ARG0;
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.ARG0, new org.apache.thrift.meta_data.FieldMetaData("arg0", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.thriftee.examples.usergroup.domain.User.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(groupNames_args.class, metaDataMap);
}
public groupNames_args() {
}
public groupNames_args(
org.thriftee.examples.usergroup.domain.User arg0)
{
this();
this.arg0 = arg0;
}
/**
* Performs a deep copy on other .
*/
public groupNames_args(groupNames_args other) {
if (other.isSetArg0()) {
this.arg0 = new org.thriftee.examples.usergroup.domain.User(other.arg0);
}
}
public groupNames_args deepCopy() {
return new groupNames_args(this);
}
@Override
public void clear() {
this.arg0 = null;
}
public org.thriftee.examples.usergroup.domain.User getArg0() {
return this.arg0;
}
public groupNames_args setArg0(org.thriftee.examples.usergroup.domain.User arg0) {
this.arg0 = arg0;
return this;
}
public void unsetArg0() {
this.arg0 = null;
}
/** Returns true if field arg0 is set (has been assigned a value) and false otherwise */
public boolean isSetArg0() {
return this.arg0 != null;
}
public void setArg0IsSet(boolean value) {
if (!value) {
this.arg0 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ARG0:
if (value == null) {
unsetArg0();
} else {
setArg0((org.thriftee.examples.usergroup.domain.User)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ARG0:
return getArg0();
}
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 ARG0:
return isSetArg0();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof groupNames_args)
return this.equals((groupNames_args)that);
return false;
}
public boolean equals(groupNames_args that) {
if (that == null)
return false;
boolean this_present_arg0 = true && this.isSetArg0();
boolean that_present_arg0 = true && that.isSetArg0();
if (this_present_arg0 || that_present_arg0) {
if (!(this_present_arg0 && that_present_arg0))
return false;
if (!this.arg0.equals(that.arg0))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_arg0 = true && (isSetArg0());
list.add(present_arg0);
if (present_arg0)
list.add(arg0);
return list.hashCode();
}
@Override
public int compareTo(groupNames_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetArg0()).compareTo(other.isSetArg0());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg0()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg0, other.arg0);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("groupNames_args(");
boolean first = true;
sb.append("arg0:");
if (this.arg0 == null) {
sb.append("null");
} else {
sb.append(this.arg0);
}
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 (arg0 != null) {
arg0.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 groupNames_argsStandardSchemeFactory implements SchemeFactory {
public groupNames_argsStandardScheme getScheme() {
return new groupNames_argsStandardScheme();
}
}
private static class groupNames_argsStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, groupNames_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: // ARG0
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.arg0 = new org.thriftee.examples.usergroup.domain.User();
struct.arg0.read(iprot);
struct.setArg0IsSet(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, groupNames_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.arg0 != null) {
oprot.writeFieldBegin(ARG0_FIELD_DESC);
struct.arg0.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class groupNames_argsTupleSchemeFactory implements SchemeFactory {
public groupNames_argsTupleScheme getScheme() {
return new groupNames_argsTupleScheme();
}
}
private static class groupNames_argsTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, groupNames_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetArg0()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetArg0()) {
struct.arg0.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, groupNames_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.arg0 = new org.thriftee.examples.usergroup.domain.User();
struct.arg0.read(iprot);
struct.setArg0IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class groupNames_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("groupNames_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new groupNames_resultStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new groupNames_resultTupleSchemeFactory();
public List success; // required
public UserGroupException ex1; // 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"),
EX1((short)1, "ex1");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // EX1
return EX1;
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.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserGroupException.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(groupNames_result.class, metaDataMap);
}
public groupNames_result() {
}
public groupNames_result(
List success,
UserGroupException ex1)
{
this();
this.success = success;
this.ex1 = ex1;
}
/**
* Performs a deep copy on other .
*/
public groupNames_result(groupNames_result other) {
if (other.isSetSuccess()) {
List __this__success = new ArrayList(other.success);
this.success = __this__success;
}
if (other.isSetEx1()) {
this.ex1 = new UserGroupException(other.ex1);
}
}
public groupNames_result deepCopy() {
return new groupNames_result(this);
}
@Override
public void clear() {
this.success = null;
this.ex1 = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(String elem) {
if (this.success == null) {
this.success = new ArrayList();
}
this.success.add(elem);
}
public List getSuccess() {
return this.success;
}
public groupNames_result setSuccess(List 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 UserGroupException getEx1() {
return this.ex1;
}
public groupNames_result setEx1(UserGroupException ex1) {
this.ex1 = ex1;
return this;
}
public void unsetEx1() {
this.ex1 = null;
}
/** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
public boolean isSetEx1() {
return this.ex1 != null;
}
public void setEx1IsSet(boolean value) {
if (!value) {
this.ex1 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((List)value);
}
break;
case EX1:
if (value == null) {
unsetEx1();
} else {
setEx1((UserGroupException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case EX1:
return getEx1();
}
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();
case EX1:
return isSetEx1();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof groupNames_result)
return this.equals((groupNames_result)that);
return false;
}
public boolean equals(groupNames_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;
}
boolean this_present_ex1 = true && this.isSetEx1();
boolean that_present_ex1 = true && that.isSetEx1();
if (this_present_ex1 || that_present_ex1) {
if (!(this_present_ex1 && that_present_ex1))
return false;
if (!this.ex1.equals(that.ex1))
return false;
}
return true;
}
@Override
public int hashCode() {
List list = new ArrayList();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
boolean present_ex1 = true && (isSetEx1());
list.add(present_ex1);
if (present_ex1)
list.add(ex1);
return list.hashCode();
}
@Override
public int compareTo(groupNames_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEx1()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
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 {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("groupNames_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("ex1:");
if (this.ex1 == null) {
sb.append("null");
} else {
sb.append(this.ex1);
}
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 groupNames_resultStandardSchemeFactory implements SchemeFactory {
public groupNames_resultStandardScheme getScheme() {
return new groupNames_resultStandardScheme();
}
}
private static class groupNames_resultStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, groupNames_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.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
struct.success = new ArrayList(_list0.size);
String _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = iprot.readString();
struct.success.add(_elem1);
}
iprot.readListEnd();
}
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // EX1
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(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, groupNames_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
for (String _iter3 : struct.success)
{
oprot.writeString(_iter3);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.ex1 != null) {
oprot.writeFieldBegin(EX1_FIELD_DESC);
struct.ex1.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class groupNames_resultTupleSchemeFactory implements SchemeFactory {
public groupNames_resultTupleScheme getScheme() {
return new groupNames_resultTupleScheme();
}
}
private static class groupNames_resultTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, groupNames_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetEx1()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (String _iter4 : struct.success)
{
oprot.writeString(_iter4);
}
}
}
if (struct.isSetEx1()) {
struct.ex1.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, groupNames_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
struct.success = new ArrayList(_list5.size);
String _elem6;
for (int _i7 = 0; _i7 < _list5.size; ++_i7)
{
_elem6 = iprot.readString();
struct.success.add(_elem6);
}
}
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.ex1 = new UserGroupException();
struct.ex1.read(iprot);
struct.setEx1IsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}