package com.ganji.as.thrift.protocol.client.test;
/**
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
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 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 PostLimitServiceFinagle {
public interface Iface {
public OperateResult getPostLimit(String strJSONParam, String token) throws ParamterException, OperationException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void getPostLimit(String strJSONParam, String token, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPostLimit_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 OperateResult getPostLimit(String strJSONParam, String token) throws ParamterException, OperationException, org.apache.thrift.TException
{
send_getPostLimit(strJSONParam, token);
return recv_getPostLimit();
}
public void send_getPostLimit(String strJSONParam, String token) throws org.apache.thrift.TException
{
getPostLimit_args args = new getPostLimit_args();
args.setStrJSONParam(strJSONParam);
args.setToken(token);
sendBase("getPostLimit", args);
}
public OperateResult recv_getPostLimit() throws ParamterException, OperationException, org.apache.thrift.TException
{
getPostLimit_result result = new getPostLimit_result();
receiveBase(result, "getPostLimit");
if (result.isSetSuccess()) {
return result.success;
}
if (result.pe != null) {
throw result.pe;
}
if (result.oe != null) {
throw result.oe;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPostLimit failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void getPostLimit(String strJSONParam, String token, org.apache.thrift.async.AsyncMethodCallback<getPostLimit_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
getPostLimit_call method_call = new getPostLimit_call(strJSONParam, token, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getPostLimit_call extends org.apache.thrift.async.TAsyncMethodCall {
private String strJSONParam;
private String token;
public getPostLimit_call(String strJSONParam, String token, org.apache.thrift.async.AsyncMethodCallback<getPostLimit_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.strJSONParam = strJSONParam;
this.token = token;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPostLimit", org.apache.thrift.protocol.TMessageType.CALL, 0));
getPostLimit_args args = new getPostLimit_args();
args.setStrJSONParam(strJSONParam);
args.setToken(token);
args.write(prot);
prot.writeMessageEnd();
}
public OperateResult getResult() throws ParamterException, OperationException, 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_getPostLimit();
}
}
}
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("getPostLimit", new getPostLimit());
return processMap;
}
private static class getPostLimit<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPostLimit_args> {
public getPostLimit() {
super("getPostLimit");
}
protected getPostLimit_args getEmptyArgsInstance() {
return new getPostLimit_args();
}
protected getPostLimit_result getResult(I iface, getPostLimit_args args) throws org.apache.thrift.TException {
getPostLimit_result result = new getPostLimit_result();
try {
result.success = iface.getPostLimit(args.strJSONParam, args.token);
} catch (ParamterException pe) {
result.pe = pe;
} catch (OperationException oe) {
result.oe = oe;
}
return result;
}
}
}
public static class getPostLimit_args implements org.apache.thrift.TBase<getPostLimit_args, getPostLimit_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPostLimit_args");
private static final org.apache.thrift.protocol.TField STR_JSONPARAM_FIELD_DESC = new org.apache.thrift.protocol.TField("strJSONParam", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getPostLimit_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new getPostLimit_argsTupleSchemeFactory());
}
public String strJSONParam; // required
public String token; // 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 {
STR_JSONPARAM((short)1, "strJSONParam"),
TOKEN((short)2, "token");
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: // STR_JSONPARAM
return STR_JSONPARAM;
case 2: // TOKEN
return TOKEN;
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.STR_JSONPARAM, new org.apache.thrift.meta_data.FieldMetaData("strJSONParam", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", 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(getPostLimit_args.class, metaDataMap);
}
public getPostLimit_args() {
}
public getPostLimit_args(
String strJSONParam,
String token)
{
this();
this.strJSONParam = strJSONParam;
this.token = token;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getPostLimit_args(getPostLimit_args other) {
if (other.isSetStrJSONParam()) {
this.strJSONParam = other.strJSONParam;
}
if (other.isSetToken()) {
this.token = other.token;
}
}
public getPostLimit_args deepCopy() {
return new getPostLimit_args(this);
}
@Override
public void clear() {
this.strJSONParam = null;
this.token = null;
}
public String getStrJSONParam() {
return this.strJSONParam;
}
public getPostLimit_args setStrJSONParam(String strJSONParam) {
this.strJSONParam = strJSONParam;
return this;
}
public void unsetStrJSONParam() {
this.strJSONParam = null;
}
/** Returns true if field strJSONParam is set (has been assigned a value) and false otherwise */
public boolean isSetStrJSONParam() {
return this.strJSONParam != null;
}
public void setStrJSONParamIsSet(boolean value) {
if (!value) {
this.strJSONParam = null;
}
}
public String getToken() {
return this.token;
}
public getPostLimit_args setToken(String token) {
this.token = token;
return this;
}
public void unsetToken() {
this.token = null;
}
/** Returns true if field token is set (has been assigned a value) and false otherwise */
public boolean isSetToken() {
return this.token != null;
}
public void setTokenIsSet(boolean value) {
if (!value) {
this.token = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STR_JSONPARAM:
if (value == null) {
unsetStrJSONParam();
} else {
setStrJSONParam((String)value);
}
break;
case TOKEN:
if (value == null) {
unsetToken();
} else {
setToken((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case STR_JSONPARAM:
return getStrJSONParam();
case TOKEN:
return getToken();
}
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 STR_JSONPARAM:
return isSetStrJSONParam();
case TOKEN:
return isSetToken();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getPostLimit_args)
return this.equals((getPostLimit_args)that);
return false;
}
public boolean equals(getPostLimit_args that) {
if (that == null)
return false;
boolean this_present_strJSONParam = true && this.isSetStrJSONParam();
boolean that_present_strJSONParam = true && that.isSetStrJSONParam();
if (this_present_strJSONParam || that_present_strJSONParam) {
if (!(this_present_strJSONParam && that_present_strJSONParam))
return false;
if (!this.strJSONParam.equals(that.strJSONParam))
return false;
}
boolean this_present_token = true && this.isSetToken();
boolean that_present_token = true && that.isSetToken();
if (this_present_token || that_present_token) {
if (!(this_present_token && that_present_token))
return false;
if (!this.token.equals(that.token))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getPostLimit_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getPostLimit_args typedOther = (getPostLimit_args)other;
lastComparison = Boolean.valueOf(isSetStrJSONParam()).compareTo(typedOther.isSetStrJSONParam());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStrJSONParam()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.strJSONParam, typedOther.strJSONParam);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetToken()).compareTo(typedOther.isSetToken());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetToken()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, typedOther.token);
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("getPostLimit_args(");
boolean first = true;
sb.append("strJSONParam:");
if (this.strJSONParam == null) {
sb.append("null");
} else {
sb.append(this.strJSONParam);
}
first = false;
if (!first) sb.append(", ");
sb.append("token:");
if (this.token == null) {
sb.append("null");
} else {
sb.append(this.token);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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 getPostLimit_argsStandardSchemeFactory implements SchemeFactory {
public getPostLimit_argsStandardScheme getScheme() {
return new getPostLimit_argsStandardScheme();
}
}
private static class getPostLimit_argsStandardScheme extends StandardScheme<getPostLimit_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getPostLimit_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: // STR_JSONPARAM
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.strJSONParam = iprot.readString();
struct.setStrJSONParamIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // TOKEN
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.token = iprot.readString();
struct.setTokenIsSet(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, getPostLimit_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.strJSONParam != null) {
oprot.writeFieldBegin(STR_JSONPARAM_FIELD_DESC);
oprot.writeString(struct.strJSONParam);
oprot.writeFieldEnd();
}
if (struct.token != null) {
oprot.writeFieldBegin(TOKEN_FIELD_DESC);
oprot.writeString(struct.token);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getPostLimit_argsTupleSchemeFactory implements SchemeFactory {
public getPostLimit_argsTupleScheme getScheme() {
return new getPostLimit_argsTupleScheme();
}
}
private static class getPostLimit_argsTupleScheme extends TupleScheme<getPostLimit_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getPostLimit_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetStrJSONParam()) {
optionals.set(0);
}
if (struct.isSetToken()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetStrJSONParam()) {
oprot.writeString(struct.strJSONParam);
}
if (struct.isSetToken()) {
oprot.writeString(struct.token);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getPostLimit_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.strJSONParam = iprot.readString();
struct.setStrJSONParamIsSet(true);
}
if (incoming.get(1)) {
struct.token = iprot.readString();
struct.setTokenIsSet(true);
}
}
}
}
public static class getPostLimit_result implements org.apache.thrift.TBase<getPostLimit_result, getPostLimit_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPostLimit_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 PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField OE_FIELD_DESC = new org.apache.thrift.protocol.TField("oe", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getPostLimit_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new getPostLimit_resultTupleSchemeFactory());
}
public OperateResult success; // required
public ParamterException pe; // required
public OperationException oe; // 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"),
PE((short)1, "pe"),
OE((short)2, "oe");
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;
case 1: // PE
return PE;
case 2: // OE
return OE;
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, OperateResult.class)));
tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.OE, new org.apache.thrift.meta_data.FieldMetaData("oe", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPostLimit_result.class, metaDataMap);
}
public getPostLimit_result() {
}
public getPostLimit_result(
OperateResult success,
ParamterException pe,
OperationException oe)
{
this();
this.success = success;
this.pe = pe;
this.oe = oe;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getPostLimit_result(getPostLimit_result other) {
if (other.isSetSuccess()) {
this.success = new OperateResult(other.success);
}
if (other.isSetPe()) {
this.pe = new ParamterException(other.pe);
}
if (other.isSetOe()) {
this.oe = new OperationException(other.oe);
}
}
public getPostLimit_result deepCopy() {
return new getPostLimit_result(this);
}
@Override
public void clear() {
this.success = null;
this.pe = null;
this.oe = null;
}
public OperateResult getSuccess() {
return this.success;
}
public getPostLimit_result setSuccess(OperateResult 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 ParamterException getPe() {
return this.pe;
}
public getPostLimit_result setPe(ParamterException pe) {
this.pe = pe;
return this;
}
public void unsetPe() {
this.pe = null;
}
/** Returns true if field pe is set (has been assigned a value) and false otherwise */
public boolean isSetPe() {
return this.pe != null;
}
public void setPeIsSet(boolean value) {
if (!value) {
this.pe = null;
}
}
public OperationException getOe() {
return this.oe;
}
public getPostLimit_result setOe(OperationException oe) {
this.oe = oe;
return this;
}
public void unsetOe() {
this.oe = null;
}
/** Returns true if field oe is set (has been assigned a value) and false otherwise */
public boolean isSetOe() {
return this.oe != null;
}
public void setOeIsSet(boolean value) {
if (!value) {
this.oe = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((OperateResult)value);
}
break;
case PE:
if (value == null) {
unsetPe();
} else {
setPe((ParamterException)value);
}
break;
case OE:
if (value == null) {
unsetOe();
} else {
setOe((OperationException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case PE:
return getPe();
case OE:
return getOe();
}
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 PE:
return isSetPe();
case OE:
return isSetOe();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getPostLimit_result)
return this.equals((getPostLimit_result)that);
return false;
}
public boolean equals(getPostLimit_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_pe = true && this.isSetPe();
boolean that_present_pe = true && that.isSetPe();
if (this_present_pe || that_present_pe) {
if (!(this_present_pe && that_present_pe))
return false;
if (!this.pe.equals(that.pe))
return false;
}
boolean this_present_oe = true && this.isSetOe();
boolean that_present_oe = true && that.isSetOe();
if (this_present_oe || that_present_oe) {
if (!(this_present_oe && that_present_oe))
return false;
if (!this.oe.equals(that.oe))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getPostLimit_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getPostLimit_result typedOther = (getPostLimit_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;
}
}
lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPe()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetOe()).compareTo(typedOther.isSetOe());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOe()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.oe, typedOther.oe);
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("getPostLimit_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("pe:");
if (this.pe == null) {
sb.append("null");
} else {
sb.append(this.pe);
}
first = false;
if (!first) sb.append(", ");
sb.append("oe:");
if (this.oe == null) {
sb.append("null");
} else {
sb.append(this.oe);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
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 getPostLimit_resultStandardSchemeFactory implements SchemeFactory {
public getPostLimit_resultStandardScheme getScheme() {
return new getPostLimit_resultStandardScheme();
}
}
private static class getPostLimit_resultStandardScheme extends StandardScheme<getPostLimit_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getPostLimit_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 OperateResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // PE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.pe = new ParamterException();
struct.pe.read(iprot);
struct.setPeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // OE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.oe = new OperationException();
struct.oe.read(iprot);
struct.setOeIsSet(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, getPostLimit_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.pe != null) {
oprot.writeFieldBegin(PE_FIELD_DESC);
struct.pe.write(oprot);
oprot.writeFieldEnd();
}
if (struct.oe != null) {
oprot.writeFieldBegin(OE_FIELD_DESC);
struct.oe.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getPostLimit_resultTupleSchemeFactory implements SchemeFactory {
public getPostLimit_resultTupleScheme getScheme() {
return new getPostLimit_resultTupleScheme();
}
}
private static class getPostLimit_resultTupleScheme extends TupleScheme<getPostLimit_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getPostLimit_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetPe()) {
optionals.set(1);
}
if (struct.isSetOe()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetPe()) {
struct.pe.write(oprot);
}
if (struct.isSetOe()) {
struct.oe.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getPostLimit_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new OperateResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.pe = new ParamterException();
struct.pe.read(iprot);
struct.setPeIsSet(true);
}
if (incoming.get(2)) {
struct.oe = new OperationException();
struct.oe.read(iprot);
struct.setOeIsSet(true);
}
}
}
}
}