/**
* Autogenerated by Thrift Compiler (0.9.2)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.xiaomi.infra.galaxy.lcs.thrift;
import libthrift091.scheme.IScheme;
import libthrift091.scheme.SchemeFactory;
import libthrift091.scheme.StandardScheme;
import libthrift091.scheme.TupleScheme;
import libthrift091.protocol.TTupleProtocol;
import libthrift091.protocol.TProtocolException;
import libthrift091.EncodingUtils;
import libthrift091.TException;
import libthrift091.async.AsyncMethodCallback;
import libthrift091.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-11-9")
public class LCSThriftService {
public interface Iface {
public void Record(Record record) throws GalaxyLCSException, libthrift091.TException;
}
public interface AsyncIface {
public void Record(Record record, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException;
}
public static class Client extends libthrift091.TServiceClient implements Iface {
public static class Factory implements libthrift091.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(libthrift091.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(libthrift091.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public void Record(Record record) throws GalaxyLCSException, libthrift091.TException
{
send_Record(record);
recv_Record();
}
public void send_Record(Record record) throws libthrift091.TException
{
Record_args args = new Record_args();
args.setRecord(record);
sendBase("Record", args);
}
public void recv_Record() throws GalaxyLCSException, libthrift091.TException
{
Record_result result = new Record_result();
receiveBase(result, "Record");
if (result.e != null) {
throw result.e;
}
return;
}
}
public static class AsyncClient extends libthrift091.async.TAsyncClient implements AsyncIface {
public static class Factory implements libthrift091.async.TAsyncClientFactory<AsyncClient> {
private libthrift091.async.TAsyncClientManager clientManager;
private libthrift091.protocol.TProtocolFactory protocolFactory;
public Factory(libthrift091.async.TAsyncClientManager clientManager, libthrift091.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(libthrift091.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.async.TAsyncClientManager clientManager, libthrift091.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void Record(Record record, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException {
checkReady();
Record_call method_call = new Record_call(record, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class Record_call extends libthrift091.async.TAsyncMethodCall {
private Record record;
public Record_call(Record record, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.record = record;
}
public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException {
prot.writeMessageBegin(new libthrift091.protocol.TMessage("Record", libthrift091.protocol.TMessageType.CALL, 0));
Record_args args = new Record_args();
args.setRecord(record);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws GalaxyLCSException, libthrift091.TException {
if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array());
libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_Record();
}
}
}
public static class Processor<I extends Iface> extends libthrift091.TBaseProcessor<I> implements libthrift091.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>>()));
}
protected Processor(I iface, Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> getProcessMap(Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) {
processMap.put("Record", new Record());
return processMap;
}
public static class Record<I extends Iface> extends libthrift091.ProcessFunction<I, Record_args> {
public Record() {
super("Record");
}
public Record_args getEmptyArgsInstance() {
return new Record_args();
}
protected boolean isOneway() {
return false;
}
public Record_result getResult(I iface, Record_args args) throws libthrift091.TException {
Record_result result = new Record_result();
try {
iface.Record(args.record);
} catch (GalaxyLCSException e) {
result.e = e;
}
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends libthrift091.TBaseAsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>>()));
}
protected AsyncProcessor(I iface, Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase,?>> getProcessMap(Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) {
processMap.put("Record", new Record());
return processMap;
}
public static class Record<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, Record_args, Void> {
public Record() {
super("Record");
}
public Record_args getEmptyArgsInstance() {
return new Record_args();
}
public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Void>() {
public void onComplete(Void o) {
Record_result result = new Record_result();
try {
fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY;
libthrift091.TBase msg;
Record_result result = new Record_result();
if (e instanceof GalaxyLCSException) {
result.e = (GalaxyLCSException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = libthrift091.protocol.TMessageType.EXCEPTION;
msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, Record_args args, libthrift091.async.AsyncMethodCallback<Void> resultHandler) throws TException {
iface.Record(args.record,resultHandler);
}
}
}
public static class Record_args implements libthrift091.TBase<Record_args, Record_args._Fields>, java.io.Serializable, Cloneable, Comparable<Record_args> {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("Record_args");
private static final libthrift091.protocol.TField RECORD_FIELD_DESC = new libthrift091.protocol.TField("record", libthrift091.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new Record_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new Record_argsTupleSchemeFactory());
}
public Record record; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
RECORD((short)1, "record");
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: // RECORD
return RECORD;
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, libthrift091.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.RECORD, new libthrift091.meta_data.FieldMetaData("record", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, Record.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(Record_args.class, metaDataMap);
}
public Record_args() {
}
public Record_args(
Record record)
{
this();
this.record = record;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Record_args(Record_args other) {
if (other.isSetRecord()) {
this.record = new Record(other.record);
}
}
public Record_args deepCopy() {
return new Record_args(this);
}
@Override
public void clear() {
this.record = null;
}
public Record getRecord() {
return this.record;
}
public Record_args setRecord(Record record) {
this.record = record;
return this;
}
public void unsetRecord() {
this.record = null;
}
/** Returns true if field record is set (has been assigned a value) and false otherwise */
public boolean isSetRecord() {
return this.record != null;
}
public void setRecordIsSet(boolean value) {
if (!value) {
this.record = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case RECORD:
if (value == null) {
unsetRecord();
} else {
setRecord((Record)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case RECORD:
return getRecord();
}
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 RECORD:
return isSetRecord();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Record_args)
return this.equals((Record_args)that);
return false;
}
public boolean equals(Record_args that) {
if (that == null)
return false;
boolean this_present_record = true && this.isSetRecord();
boolean that_present_record = true && that.isSetRecord();
if (this_present_record || that_present_record) {
if (!(this_present_record && that_present_record))
return false;
if (!this.record.equals(that.record))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_record = true && (isSetRecord());
list.add(present_record);
if (present_record)
list.add(record);
return list.hashCode();
}
@Override
public int compareTo(Record_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetRecord()).compareTo(other.isSetRecord());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRecord()) {
lastComparison = libthrift091.TBaseHelper.compareTo(this.record, other.record);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Record_args(");
boolean first = true;
sb.append("record:");
if (this.record == null) {
sb.append("null");
} else {
sb.append(this.record);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws libthrift091.TException {
// check for required fields
// check for sub-struct validity
if (record != null) {
record.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out)));
} catch (libthrift091.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in)));
} catch (libthrift091.TException te) {
throw new java.io.IOException(te);
}
}
private static class Record_argsStandardSchemeFactory implements SchemeFactory {
public Record_argsStandardScheme getScheme() {
return new Record_argsStandardScheme();
}
}
private static class Record_argsStandardScheme extends StandardScheme<Record_args> {
public void read(libthrift091.protocol.TProtocol iprot, Record_args struct) throws libthrift091.TException {
libthrift091.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == libthrift091.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // RECORD
if (schemeField.type == libthrift091.protocol.TType.STRUCT) {
struct.record = new Record();
struct.record.read(iprot);
struct.setRecordIsSet(true);
} else {
libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
libthrift091.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(libthrift091.protocol.TProtocol oprot, Record_args struct) throws libthrift091.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.record != null) {
oprot.writeFieldBegin(RECORD_FIELD_DESC);
struct.record.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class Record_argsTupleSchemeFactory implements SchemeFactory {
public Record_argsTupleScheme getScheme() {
return new Record_argsTupleScheme();
}
}
private static class Record_argsTupleScheme extends TupleScheme<Record_args> {
@Override
public void write(libthrift091.protocol.TProtocol prot, Record_args struct) throws libthrift091.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetRecord()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetRecord()) {
struct.record.write(oprot);
}
}
@Override
public void read(libthrift091.protocol.TProtocol prot, Record_args struct) throws libthrift091.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.record = new Record();
struct.record.read(iprot);
struct.setRecordIsSet(true);
}
}
}
}
public static class Record_result implements libthrift091.TBase<Record_result, Record_result._Fields>, java.io.Serializable, Cloneable, Comparable<Record_result> {
private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("Record_result");
private static final libthrift091.protocol.TField E_FIELD_DESC = new libthrift091.protocol.TField("e", libthrift091.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new Record_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new Record_resultTupleSchemeFactory());
}
public GalaxyLCSException e; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements libthrift091.TFieldIdEnum {
E((short)1, "e");
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: // E
return E;
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, libthrift091.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.E, new libthrift091.meta_data.FieldMetaData("e", libthrift091.TFieldRequirementType.DEFAULT,
new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(Record_result.class, metaDataMap);
}
public Record_result() {
}
public Record_result(
GalaxyLCSException e)
{
this();
this.e = e;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Record_result(Record_result other) {
if (other.isSetE()) {
this.e = new GalaxyLCSException(other.e);
}
}
public Record_result deepCopy() {
return new Record_result(this);
}
@Override
public void clear() {
this.e = null;
}
public GalaxyLCSException getE() {
return this.e;
}
public Record_result setE(GalaxyLCSException e) {
this.e = e;
return this;
}
public void unsetE() {
this.e = null;
}
/** Returns true if field e is set (has been assigned a value) and false otherwise */
public boolean isSetE() {
return this.e != null;
}
public void setEIsSet(boolean value) {
if (!value) {
this.e = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case E:
if (value == null) {
unsetE();
} else {
setE((GalaxyLCSException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case E:
return getE();
}
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 E:
return isSetE();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Record_result)
return this.equals((Record_result)that);
return false;
}
public boolean equals(Record_result that) {
if (that == null)
return false;
boolean this_present_e = true && this.isSetE();
boolean that_present_e = true && that.isSetE();
if (this_present_e || that_present_e) {
if (!(this_present_e && that_present_e))
return false;
if (!this.e.equals(that.e))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_e = true && (isSetE());
list.add(present_e);
if (present_e)
list.add(e);
return list.hashCode();
}
@Override
public int compareTo(Record_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetE()).compareTo(other.isSetE());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetE()) {
lastComparison = libthrift091.TBaseHelper.compareTo(this.e, other.e);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Record_result(");
boolean first = true;
sb.append("e:");
if (this.e == null) {
sb.append("null");
} else {
sb.append(this.e);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws libthrift091.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out)));
} catch (libthrift091.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in)));
} catch (libthrift091.TException te) {
throw new java.io.IOException(te);
}
}
private static class Record_resultStandardSchemeFactory implements SchemeFactory {
public Record_resultStandardScheme getScheme() {
return new Record_resultStandardScheme();
}
}
private static class Record_resultStandardScheme extends StandardScheme<Record_result> {
public void read(libthrift091.protocol.TProtocol iprot, Record_result struct) throws libthrift091.TException {
libthrift091.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == libthrift091.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // E
if (schemeField.type == libthrift091.protocol.TType.STRUCT) {
struct.e = new GalaxyLCSException();
struct.e.read(iprot);
struct.setEIsSet(true);
} else {
libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
libthrift091.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(libthrift091.protocol.TProtocol oprot, Record_result struct) throws libthrift091.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.e != null) {
oprot.writeFieldBegin(E_FIELD_DESC);
struct.e.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class Record_resultTupleSchemeFactory implements SchemeFactory {
public Record_resultTupleScheme getScheme() {
return new Record_resultTupleScheme();
}
}
private static class Record_resultTupleScheme extends TupleScheme<Record_result> {
@Override
public void write(libthrift091.protocol.TProtocol prot, Record_result struct) throws libthrift091.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetE()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetE()) {
struct.e.write(oprot);
}
}
@Override
public void read(libthrift091.protocol.TProtocol prot, Record_result struct) throws libthrift091.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.e = new GalaxyLCSException();
struct.e.read(iprot);
struct.setEIsSet(true);
}
}
}
}
}