/** * 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.emr.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-8-18") public class EMRBillService { public interface Iface extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService.Iface { public TotalBill getTotalBill(int startTime, int endTime) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException; public String printTotalBill(String month) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException; public DetailBill getDetailBill(int startTime, int endTime) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException; public String printDetailBill(String month) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException; } public interface AsyncIface extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService .AsyncIface { public void getTotalBill(int startTime, int endTime, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void printTotalBill(String month, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void getDetailBill(int startTime, int endTime, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void printDetailBill(String month, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; } public static class Client extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService.Client 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 TotalBill getTotalBill(int startTime, int endTime) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { send_getTotalBill(startTime, endTime); return recv_getTotalBill(); } public void send_getTotalBill(int startTime, int endTime) throws libthrift091.TException { getTotalBill_args args = new getTotalBill_args(); args.setStartTime(startTime); args.setEndTime(endTime); sendBase("getTotalBill", args); } public TotalBill recv_getTotalBill() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { getTotalBill_result result = new getTotalBill_result(); receiveBase(result, "getTotalBill"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "getTotalBill failed: unknown result"); } public String printTotalBill(String month) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { send_printTotalBill(month); return recv_printTotalBill(); } public void send_printTotalBill(String month) throws libthrift091.TException { printTotalBill_args args = new printTotalBill_args(); args.setMonth(month); sendBase("printTotalBill", args); } public String recv_printTotalBill() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { printTotalBill_result result = new printTotalBill_result(); receiveBase(result, "printTotalBill"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "printTotalBill failed: unknown result"); } public DetailBill getDetailBill(int startTime, int endTime) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { send_getDetailBill(startTime, endTime); return recv_getDetailBill(); } public void send_getDetailBill(int startTime, int endTime) throws libthrift091.TException { getDetailBill_args args = new getDetailBill_args(); args.setStartTime(startTime); args.setEndTime(endTime); sendBase("getDetailBill", args); } public DetailBill recv_getDetailBill() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { getDetailBill_result result = new getDetailBill_result(); receiveBase(result, "getDetailBill"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "getDetailBill failed: unknown result"); } public String printDetailBill(String month) throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { send_printDetailBill(month); return recv_printDetailBill(); } public void send_printDetailBill(String month) throws libthrift091.TException { printDetailBill_args args = new printDetailBill_args(); args.setMonth(month); sendBase("printDetailBill", args); } public String recv_printDetailBill() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, libthrift091.TException { printDetailBill_result result = new printDetailBill_result(); receiveBase(result, "printDetailBill"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "printDetailBill failed: unknown result"); } } public static class AsyncClient extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService.AsyncClient 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 getTotalBill(int startTime, int endTime, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); getTotalBill_call method_call = new getTotalBill_call(startTime, endTime, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getTotalBill_call extends libthrift091.async.TAsyncMethodCall { private int startTime; private int endTime; public getTotalBill_call(int startTime, int endTime, 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.startTime = startTime; this.endTime = endTime; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("getTotalBill", libthrift091.protocol.TMessageType.CALL, 0)); getTotalBill_args args = new getTotalBill_args(); args.setStartTime(startTime); args.setEndTime(endTime); args.write(prot); prot.writeMessageEnd(); } public TotalBill getResult() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, 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); return (new Client(prot)).recv_getTotalBill(); } } public void printTotalBill(String month, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); printTotalBill_call method_call = new printTotalBill_call(month, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class printTotalBill_call extends libthrift091.async.TAsyncMethodCall { private String month; public printTotalBill_call(String month, 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.month = month; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("printTotalBill", libthrift091.protocol.TMessageType.CALL, 0)); printTotalBill_args args = new printTotalBill_args(); args.setMonth(month); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, 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); return (new Client(prot)).recv_printTotalBill(); } } public void getDetailBill(int startTime, int endTime, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); getDetailBill_call method_call = new getDetailBill_call(startTime, endTime, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getDetailBill_call extends libthrift091.async.TAsyncMethodCall { private int startTime; private int endTime; public getDetailBill_call(int startTime, int endTime, 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.startTime = startTime; this.endTime = endTime; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("getDetailBill", libthrift091.protocol.TMessageType.CALL, 0)); getDetailBill_args args = new getDetailBill_args(); args.setStartTime(startTime); args.setEndTime(endTime); args.write(prot); prot.writeMessageEnd(); } public DetailBill getResult() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, 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); return (new Client(prot)).recv_getDetailBill(); } } public void printDetailBill(String month, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); printDetailBill_call method_call = new printDetailBill_call(month, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class printDetailBill_call extends libthrift091.async.TAsyncMethodCall { private String month; public printDetailBill_call(String month, 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.month = month; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("printDetailBill", libthrift091.protocol.TMessageType.CALL, 0)); printDetailBill_args args = new printDetailBill_args(); args.setMonth(month); args.write(prot); prot.writeMessageEnd(); } public String getResult() throws com.xiaomi.infra.galaxy.rpc.thrift.ServiceException, 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); return (new Client(prot)).recv_printDetailBill(); } } } public static class Processor<I extends Iface> extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService.Processor<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("getTotalBill", new getTotalBill()); processMap.put("printTotalBill", new printTotalBill()); processMap.put("getDetailBill", new getDetailBill()); processMap.put("printDetailBill", new printDetailBill()); return processMap; } public static class getTotalBill<I extends Iface> extends libthrift091.ProcessFunction<I, getTotalBill_args> { public getTotalBill() { super("getTotalBill"); } public getTotalBill_args getEmptyArgsInstance() { return new getTotalBill_args(); } protected boolean isOneway() { return false; } public getTotalBill_result getResult(I iface, getTotalBill_args args) throws libthrift091.TException { getTotalBill_result result = new getTotalBill_result(); try { result.success = iface.getTotalBill(args.startTime, args.endTime); } catch (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { result.se = se; } return result; } } public static class printTotalBill<I extends Iface> extends libthrift091.ProcessFunction<I, printTotalBill_args> { public printTotalBill() { super("printTotalBill"); } public printTotalBill_args getEmptyArgsInstance() { return new printTotalBill_args(); } protected boolean isOneway() { return false; } public printTotalBill_result getResult(I iface, printTotalBill_args args) throws libthrift091.TException { printTotalBill_result result = new printTotalBill_result(); try { result.success = iface.printTotalBill(args.month); } catch (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { result.se = se; } return result; } } public static class getDetailBill<I extends Iface> extends libthrift091.ProcessFunction<I, getDetailBill_args> { public getDetailBill() { super("getDetailBill"); } public getDetailBill_args getEmptyArgsInstance() { return new getDetailBill_args(); } protected boolean isOneway() { return false; } public getDetailBill_result getResult(I iface, getDetailBill_args args) throws libthrift091.TException { getDetailBill_result result = new getDetailBill_result(); try { result.success = iface.getDetailBill(args.startTime, args.endTime); } catch (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { result.se = se; } return result; } } public static class printDetailBill<I extends Iface> extends libthrift091.ProcessFunction<I, printDetailBill_args> { public printDetailBill() { super("printDetailBill"); } public printDetailBill_args getEmptyArgsInstance() { return new printDetailBill_args(); } protected boolean isOneway() { return false; } public printDetailBill_result getResult(I iface, printDetailBill_args args) throws libthrift091.TException { printDetailBill_result result = new printDetailBill_result(); try { result.success = iface.printDetailBill(args.month); } catch (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { result.se = se; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends com.xiaomi.infra.galaxy.rpc.thrift.BaseService.AsyncProcessor<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("getTotalBill", new getTotalBill()); processMap.put("printTotalBill", new printTotalBill()); processMap.put("getDetailBill", new getDetailBill()); processMap.put("printDetailBill", new printDetailBill()); return processMap; } public static class getTotalBill<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, getTotalBill_args, TotalBill> { public getTotalBill() { super("getTotalBill"); } public getTotalBill_args getEmptyArgsInstance() { return new getTotalBill_args(); } public AsyncMethodCallback<TotalBill> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<TotalBill>() { public void onComplete(TotalBill o) { getTotalBill_result result = new getTotalBill_result(); result.success = o; 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; getTotalBill_result result = new getTotalBill_result(); if (e instanceof com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) e; result.setSeIsSet(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, getTotalBill_args args, libthrift091.async.AsyncMethodCallback<TotalBill> resultHandler) throws TException { iface.getTotalBill(args.startTime, args.endTime,resultHandler); } } public static class printTotalBill<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, printTotalBill_args, String> { public printTotalBill() { super("printTotalBill"); } public printTotalBill_args getEmptyArgsInstance() { return new printTotalBill_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { printTotalBill_result result = new printTotalBill_result(); result.success = o; 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; printTotalBill_result result = new printTotalBill_result(); if (e instanceof com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) e; result.setSeIsSet(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, printTotalBill_args args, libthrift091.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.printTotalBill(args.month,resultHandler); } } public static class getDetailBill<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, getDetailBill_args, DetailBill> { public getDetailBill() { super("getDetailBill"); } public getDetailBill_args getEmptyArgsInstance() { return new getDetailBill_args(); } public AsyncMethodCallback<DetailBill> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<DetailBill>() { public void onComplete(DetailBill o) { getDetailBill_result result = new getDetailBill_result(); result.success = o; 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; getDetailBill_result result = new getDetailBill_result(); if (e instanceof com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) e; result.setSeIsSet(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, getDetailBill_args args, libthrift091.async.AsyncMethodCallback<DetailBill> resultHandler) throws TException { iface.getDetailBill(args.startTime, args.endTime,resultHandler); } } public static class printDetailBill<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, printDetailBill_args, String> { public printDetailBill() { super("printDetailBill"); } public printDetailBill_args getEmptyArgsInstance() { return new printDetailBill_args(); } public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<String>() { public void onComplete(String o) { printDetailBill_result result = new printDetailBill_result(); result.success = o; 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; printDetailBill_result result = new printDetailBill_result(); if (e instanceof com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.rpc.thrift.ServiceException) e; result.setSeIsSet(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, printDetailBill_args args, libthrift091.async.AsyncMethodCallback<String> resultHandler) throws TException { iface.printDetailBill(args.month,resultHandler); } } } public static class getTotalBill_args implements libthrift091.TBase<getTotalBill_args, getTotalBill_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTotalBill_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("getTotalBill_args"); private static final libthrift091.protocol.TField START_TIME_FIELD_DESC = new libthrift091.protocol.TField("startTime", libthrift091.protocol.TType.I32, (short)1); private static final libthrift091.protocol.TField END_TIME_FIELD_DESC = new libthrift091.protocol.TField("endTime", libthrift091.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getTotalBill_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getTotalBill_argsTupleSchemeFactory()); } public int startTime; // required public int endTime; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { START_TIME((short)1, "startTime"), END_TIME((short)2, "endTime"); 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: // START_TIME return START_TIME; case 2: // END_TIME return END_TIME; 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 __STARTTIME_ISSET_ID = 0; private static final int __ENDTIME_ISSET_ID = 1; private byte __isset_bitfield = 0; 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.START_TIME, new libthrift091.meta_data.FieldMetaData("startTime", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.END_TIME, new libthrift091.meta_data.FieldMetaData("endTime", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(getTotalBill_args.class, metaDataMap); } public getTotalBill_args() { } public getTotalBill_args( int startTime, int endTime) { this(); this.startTime = startTime; setStartTimeIsSet(true); this.endTime = endTime; setEndTimeIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public getTotalBill_args(getTotalBill_args other) { __isset_bitfield = other.__isset_bitfield; this.startTime = other.startTime; this.endTime = other.endTime; } public getTotalBill_args deepCopy() { return new getTotalBill_args(this); } @Override public void clear() { setStartTimeIsSet(false); this.startTime = 0; setEndTimeIsSet(false); this.endTime = 0; } public int getStartTime() { return this.startTime; } public getTotalBill_args setStartTime(int startTime) { this.startTime = startTime; setStartTimeIsSet(true); return this; } public void unsetStartTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } public int getEndTime() { return this.endTime; } public getTotalBill_args setEndTime(int endTime) { this.endTime = endTime; setEndTimeIsSet(true); return this; } public void unsetEndTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID); } /** Returns true if field endTime is set (has been assigned a value) and false otherwise */ public boolean isSetEndTime() { return EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID); } public void setEndTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case START_TIME: if (value == null) { unsetStartTime(); } else { setStartTime((Integer)value); } break; case END_TIME: if (value == null) { unsetEndTime(); } else { setEndTime((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case START_TIME: return Integer.valueOf(getStartTime()); case END_TIME: return Integer.valueOf(getEndTime()); } 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 START_TIME: return isSetStartTime(); case END_TIME: return isSetEndTime(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getTotalBill_args) return this.equals((getTotalBill_args)that); return false; } public boolean equals(getTotalBill_args that) { if (that == null) return false; boolean this_present_startTime = true; boolean that_present_startTime = true; if (this_present_startTime || that_present_startTime) { if (!(this_present_startTime && that_present_startTime)) return false; if (this.startTime != that.startTime) return false; } boolean this_present_endTime = true; boolean that_present_endTime = true; if (this_present_endTime || that_present_endTime) { if (!(this_present_endTime && that_present_endTime)) return false; if (this.endTime != that.endTime) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_startTime = true; list.add(present_startTime); if (present_startTime) list.add(startTime); boolean present_endTime = true; list.add(present_endTime); if (present_endTime) list.add(endTime); return list.hashCode(); } @Override public int compareTo(getTotalBill_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } if (isSetStartTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.startTime, other.startTime); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEndTime()).compareTo(other.isSetEndTime()); if (lastComparison != 0) { return lastComparison; } if (isSetEndTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.endTime, other.endTime); 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("getTotalBill_args("); boolean first = true; sb.append("startTime:"); sb.append(this.startTime); first = false; if (!first) sb.append(", "); sb.append("endTime:"); sb.append(this.endTime); 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 { // 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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class getTotalBill_argsStandardSchemeFactory implements SchemeFactory { public getTotalBill_argsStandardScheme getScheme() { return new getTotalBill_argsStandardScheme(); } } private static class getTotalBill_argsStandardScheme extends StandardScheme<getTotalBill_args> { public void read(libthrift091.protocol.TProtocol iprot, getTotalBill_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: // START_TIME if (schemeField.type == libthrift091.protocol.TType.I32) { struct.startTime = iprot.readI32(); struct.setStartTimeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // END_TIME if (schemeField.type == libthrift091.protocol.TType.I32) { struct.endTime = iprot.readI32(); struct.setEndTimeIsSet(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, getTotalBill_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI32(struct.startTime); oprot.writeFieldEnd(); oprot.writeFieldBegin(END_TIME_FIELD_DESC); oprot.writeI32(struct.endTime); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getTotalBill_argsTupleSchemeFactory implements SchemeFactory { public getTotalBill_argsTupleScheme getScheme() { return new getTotalBill_argsTupleScheme(); } } private static class getTotalBill_argsTupleScheme extends TupleScheme<getTotalBill_args> { @Override public void write(libthrift091.protocol.TProtocol prot, getTotalBill_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetStartTime()) { optionals.set(0); } if (struct.isSetEndTime()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetStartTime()) { oprot.writeI32(struct.startTime); } if (struct.isSetEndTime()) { oprot.writeI32(struct.endTime); } } @Override public void read(libthrift091.protocol.TProtocol prot, getTotalBill_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.startTime = iprot.readI32(); struct.setStartTimeIsSet(true); } if (incoming.get(1)) { struct.endTime = iprot.readI32(); struct.setEndTimeIsSet(true); } } } } public static class getTotalBill_result implements libthrift091.TBase<getTotalBill_result, getTotalBill_result._Fields>, java.io.Serializable, Cloneable, Comparable<getTotalBill_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("getTotalBill_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", 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 getTotalBill_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getTotalBill_resultTupleSchemeFactory()); } public TotalBill success; // required public com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); 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: // SE return SE; 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.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, TotalBill.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(getTotalBill_result.class, metaDataMap); } public getTotalBill_result() { } public getTotalBill_result( TotalBill success, com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public getTotalBill_result(getTotalBill_result other) { if (other.isSetSuccess()) { this.success = new TotalBill(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(other.se); } } public getTotalBill_result deepCopy() { return new getTotalBill_result(this); } @Override public void clear() { this.success = null; this.se = null; } public TotalBill getSuccess() { return this.success; } public getTotalBill_result setSuccess(TotalBill 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 com.xiaomi.infra.galaxy.rpc.thrift.ServiceException getSe() { return this.se; } public getTotalBill_result setSe(com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((TotalBill)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.rpc.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } 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 SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getTotalBill_result) return this.equals((getTotalBill_result)that); return false; } public boolean equals(getTotalBill_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_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(getTotalBill_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); 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("getTotalBill_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("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 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 getTotalBill_resultStandardSchemeFactory implements SchemeFactory { public getTotalBill_resultStandardScheme getScheme() { return new getTotalBill_resultStandardScheme(); } } private static class getTotalBill_resultStandardScheme extends StandardScheme<getTotalBill_result> { public void read(libthrift091.protocol.TProtocol iprot, getTotalBill_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 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new TotalBill(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(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, getTotalBill_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getTotalBill_resultTupleSchemeFactory implements SchemeFactory { public getTotalBill_resultTupleScheme getScheme() { return new getTotalBill_resultTupleScheme(); } } private static class getTotalBill_resultTupleScheme extends TupleScheme<getTotalBill_result> { @Override public void write(libthrift091.protocol.TProtocol prot, getTotalBill_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, getTotalBill_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new TotalBill(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class printTotalBill_args implements libthrift091.TBase<printTotalBill_args, printTotalBill_args._Fields>, java.io.Serializable, Cloneable, Comparable<printTotalBill_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("printTotalBill_args"); private static final libthrift091.protocol.TField MONTH_FIELD_DESC = new libthrift091.protocol.TField("month", libthrift091.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new printTotalBill_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new printTotalBill_argsTupleSchemeFactory()); } public String month; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { MONTH((short)1, "month"); 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: // MONTH return MONTH; 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.MONTH, new libthrift091.meta_data.FieldMetaData("month", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(printTotalBill_args.class, metaDataMap); } public printTotalBill_args() { } public printTotalBill_args( String month) { this(); this.month = month; } /** * Performs a deep copy on <i>other</i>. */ public printTotalBill_args(printTotalBill_args other) { if (other.isSetMonth()) { this.month = other.month; } } public printTotalBill_args deepCopy() { return new printTotalBill_args(this); } @Override public void clear() { this.month = null; } public String getMonth() { return this.month; } public printTotalBill_args setMonth(String month) { this.month = month; return this; } public void unsetMonth() { this.month = null; } /** Returns true if field month is set (has been assigned a value) and false otherwise */ public boolean isSetMonth() { return this.month != null; } public void setMonthIsSet(boolean value) { if (!value) { this.month = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case MONTH: if (value == null) { unsetMonth(); } else { setMonth((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case MONTH: return getMonth(); } 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 MONTH: return isSetMonth(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof printTotalBill_args) return this.equals((printTotalBill_args)that); return false; } public boolean equals(printTotalBill_args that) { if (that == null) return false; boolean this_present_month = true && this.isSetMonth(); boolean that_present_month = true && that.isSetMonth(); if (this_present_month || that_present_month) { if (!(this_present_month && that_present_month)) return false; if (!this.month.equals(that.month)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_month = true && (isSetMonth()); list.add(present_month); if (present_month) list.add(month); return list.hashCode(); } @Override public int compareTo(printTotalBill_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMonth()).compareTo(other.isSetMonth()); if (lastComparison != 0) { return lastComparison; } if (isSetMonth()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.month, other.month); 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("printTotalBill_args("); boolean first = true; sb.append("month:"); if (this.month == null) { sb.append("null"); } else { sb.append(this.month); } 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 printTotalBill_argsStandardSchemeFactory implements SchemeFactory { public printTotalBill_argsStandardScheme getScheme() { return new printTotalBill_argsStandardScheme(); } } private static class printTotalBill_argsStandardScheme extends StandardScheme<printTotalBill_args> { public void read(libthrift091.protocol.TProtocol iprot, printTotalBill_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: // MONTH if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.month = iprot.readString(); struct.setMonthIsSet(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, printTotalBill_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.month != null) { oprot.writeFieldBegin(MONTH_FIELD_DESC); oprot.writeString(struct.month); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class printTotalBill_argsTupleSchemeFactory implements SchemeFactory { public printTotalBill_argsTupleScheme getScheme() { return new printTotalBill_argsTupleScheme(); } } private static class printTotalBill_argsTupleScheme extends TupleScheme<printTotalBill_args> { @Override public void write(libthrift091.protocol.TProtocol prot, printTotalBill_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetMonth()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetMonth()) { oprot.writeString(struct.month); } } @Override public void read(libthrift091.protocol.TProtocol prot, printTotalBill_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.month = iprot.readString(); struct.setMonthIsSet(true); } } } } public static class printTotalBill_result implements libthrift091.TBase<printTotalBill_result, printTotalBill_result._Fields>, java.io.Serializable, Cloneable, Comparable<printTotalBill_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("printTotalBill_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRING, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", 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 printTotalBill_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new printTotalBill_resultTupleSchemeFactory()); } public String success; // required public com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); 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: // SE return SE; 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.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(printTotalBill_result.class, metaDataMap); } public printTotalBill_result() { } public printTotalBill_result( String success, com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public printTotalBill_result(printTotalBill_result other) { if (other.isSetSuccess()) { this.success = other.success; } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(other.se); } } public printTotalBill_result deepCopy() { return new printTotalBill_result(this); } @Override public void clear() { this.success = null; this.se = null; } public String getSuccess() { return this.success; } public printTotalBill_result setSuccess(String 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 com.xiaomi.infra.galaxy.rpc.thrift.ServiceException getSe() { return this.se; } public printTotalBill_result setSe(com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.rpc.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } 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 SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof printTotalBill_result) return this.equals((printTotalBill_result)that); return false; } public boolean equals(printTotalBill_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_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(printTotalBill_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); 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("printTotalBill_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("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } 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 printTotalBill_resultStandardSchemeFactory implements SchemeFactory { public printTotalBill_resultStandardScheme getScheme() { return new printTotalBill_resultStandardScheme(); } } private static class printTotalBill_resultStandardScheme extends StandardScheme<printTotalBill_result> { public void read(libthrift091.protocol.TProtocol iprot, printTotalBill_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 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(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, printTotalBill_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class printTotalBill_resultTupleSchemeFactory implements SchemeFactory { public printTotalBill_resultTupleScheme getScheme() { return new printTotalBill_resultTupleScheme(); } } private static class printTotalBill_resultTupleScheme extends TupleScheme<printTotalBill_result> { @Override public void write(libthrift091.protocol.TProtocol prot, printTotalBill_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, printTotalBill_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class getDetailBill_args implements libthrift091.TBase<getDetailBill_args, getDetailBill_args._Fields>, java.io.Serializable, Cloneable, Comparable<getDetailBill_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("getDetailBill_args"); private static final libthrift091.protocol.TField START_TIME_FIELD_DESC = new libthrift091.protocol.TField("startTime", libthrift091.protocol.TType.I32, (short)1); private static final libthrift091.protocol.TField END_TIME_FIELD_DESC = new libthrift091.protocol.TField("endTime", libthrift091.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getDetailBill_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getDetailBill_argsTupleSchemeFactory()); } public int startTime; // required public int endTime; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { START_TIME((short)1, "startTime"), END_TIME((short)2, "endTime"); 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: // START_TIME return START_TIME; case 2: // END_TIME return END_TIME; 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 __STARTTIME_ISSET_ID = 0; private static final int __ENDTIME_ISSET_ID = 1; private byte __isset_bitfield = 0; 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.START_TIME, new libthrift091.meta_data.FieldMetaData("startTime", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); tmpMap.put(_Fields.END_TIME, new libthrift091.meta_data.FieldMetaData("endTime", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(getDetailBill_args.class, metaDataMap); } public getDetailBill_args() { } public getDetailBill_args( int startTime, int endTime) { this(); this.startTime = startTime; setStartTimeIsSet(true); this.endTime = endTime; setEndTimeIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public getDetailBill_args(getDetailBill_args other) { __isset_bitfield = other.__isset_bitfield; this.startTime = other.startTime; this.endTime = other.endTime; } public getDetailBill_args deepCopy() { return new getDetailBill_args(this); } @Override public void clear() { setStartTimeIsSet(false); this.startTime = 0; setEndTimeIsSet(false); this.endTime = 0; } public int getStartTime() { return this.startTime; } public getDetailBill_args setStartTime(int startTime) { this.startTime = startTime; setStartTimeIsSet(true); return this; } public void unsetStartTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } public int getEndTime() { return this.endTime; } public getDetailBill_args setEndTime(int endTime) { this.endTime = endTime; setEndTimeIsSet(true); return this; } public void unsetEndTime() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID); } /** Returns true if field endTime is set (has been assigned a value) and false otherwise */ public boolean isSetEndTime() { return EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID); } public void setEndTimeIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case START_TIME: if (value == null) { unsetStartTime(); } else { setStartTime((Integer)value); } break; case END_TIME: if (value == null) { unsetEndTime(); } else { setEndTime((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case START_TIME: return Integer.valueOf(getStartTime()); case END_TIME: return Integer.valueOf(getEndTime()); } 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 START_TIME: return isSetStartTime(); case END_TIME: return isSetEndTime(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getDetailBill_args) return this.equals((getDetailBill_args)that); return false; } public boolean equals(getDetailBill_args that) { if (that == null) return false; boolean this_present_startTime = true; boolean that_present_startTime = true; if (this_present_startTime || that_present_startTime) { if (!(this_present_startTime && that_present_startTime)) return false; if (this.startTime != that.startTime) return false; } boolean this_present_endTime = true; boolean that_present_endTime = true; if (this_present_endTime || that_present_endTime) { if (!(this_present_endTime && that_present_endTime)) return false; if (this.endTime != that.endTime) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_startTime = true; list.add(present_startTime); if (present_startTime) list.add(startTime); boolean present_endTime = true; list.add(present_endTime); if (present_endTime) list.add(endTime); return list.hashCode(); } @Override public int compareTo(getDetailBill_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } if (isSetStartTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.startTime, other.startTime); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEndTime()).compareTo(other.isSetEndTime()); if (lastComparison != 0) { return lastComparison; } if (isSetEndTime()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.endTime, other.endTime); 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("getDetailBill_args("); boolean first = true; sb.append("startTime:"); sb.append(this.startTime); first = false; if (!first) sb.append(", "); sb.append("endTime:"); sb.append(this.endTime); 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 { // 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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class getDetailBill_argsStandardSchemeFactory implements SchemeFactory { public getDetailBill_argsStandardScheme getScheme() { return new getDetailBill_argsStandardScheme(); } } private static class getDetailBill_argsStandardScheme extends StandardScheme<getDetailBill_args> { public void read(libthrift091.protocol.TProtocol iprot, getDetailBill_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: // START_TIME if (schemeField.type == libthrift091.protocol.TType.I32) { struct.startTime = iprot.readI32(); struct.setStartTimeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // END_TIME if (schemeField.type == libthrift091.protocol.TType.I32) { struct.endTime = iprot.readI32(); struct.setEndTimeIsSet(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, getDetailBill_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(START_TIME_FIELD_DESC); oprot.writeI32(struct.startTime); oprot.writeFieldEnd(); oprot.writeFieldBegin(END_TIME_FIELD_DESC); oprot.writeI32(struct.endTime); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getDetailBill_argsTupleSchemeFactory implements SchemeFactory { public getDetailBill_argsTupleScheme getScheme() { return new getDetailBill_argsTupleScheme(); } } private static class getDetailBill_argsTupleScheme extends TupleScheme<getDetailBill_args> { @Override public void write(libthrift091.protocol.TProtocol prot, getDetailBill_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetStartTime()) { optionals.set(0); } if (struct.isSetEndTime()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetStartTime()) { oprot.writeI32(struct.startTime); } if (struct.isSetEndTime()) { oprot.writeI32(struct.endTime); } } @Override public void read(libthrift091.protocol.TProtocol prot, getDetailBill_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.startTime = iprot.readI32(); struct.setStartTimeIsSet(true); } if (incoming.get(1)) { struct.endTime = iprot.readI32(); struct.setEndTimeIsSet(true); } } } } public static class getDetailBill_result implements libthrift091.TBase<getDetailBill_result, getDetailBill_result._Fields>, java.io.Serializable, Cloneable, Comparable<getDetailBill_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("getDetailBill_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", 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 getDetailBill_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getDetailBill_resultTupleSchemeFactory()); } public DetailBill success; // required public com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); 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: // SE return SE; 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.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, DetailBill.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(getDetailBill_result.class, metaDataMap); } public getDetailBill_result() { } public getDetailBill_result( DetailBill success, com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public getDetailBill_result(getDetailBill_result other) { if (other.isSetSuccess()) { this.success = new DetailBill(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(other.se); } } public getDetailBill_result deepCopy() { return new getDetailBill_result(this); } @Override public void clear() { this.success = null; this.se = null; } public DetailBill getSuccess() { return this.success; } public getDetailBill_result setSuccess(DetailBill 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 com.xiaomi.infra.galaxy.rpc.thrift.ServiceException getSe() { return this.se; } public getDetailBill_result setSe(com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((DetailBill)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.rpc.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } 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 SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getDetailBill_result) return this.equals((getDetailBill_result)that); return false; } public boolean equals(getDetailBill_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_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(getDetailBill_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); 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("getDetailBill_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("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 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 getDetailBill_resultStandardSchemeFactory implements SchemeFactory { public getDetailBill_resultStandardScheme getScheme() { return new getDetailBill_resultStandardScheme(); } } private static class getDetailBill_resultStandardScheme extends StandardScheme<getDetailBill_result> { public void read(libthrift091.protocol.TProtocol iprot, getDetailBill_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 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new DetailBill(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(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, getDetailBill_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getDetailBill_resultTupleSchemeFactory implements SchemeFactory { public getDetailBill_resultTupleScheme getScheme() { return new getDetailBill_resultTupleScheme(); } } private static class getDetailBill_resultTupleScheme extends TupleScheme<getDetailBill_result> { @Override public void write(libthrift091.protocol.TProtocol prot, getDetailBill_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, getDetailBill_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new DetailBill(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class printDetailBill_args implements libthrift091.TBase<printDetailBill_args, printDetailBill_args._Fields>, java.io.Serializable, Cloneable, Comparable<printDetailBill_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("printDetailBill_args"); private static final libthrift091.protocol.TField MONTH_FIELD_DESC = new libthrift091.protocol.TField("month", libthrift091.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new printDetailBill_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new printDetailBill_argsTupleSchemeFactory()); } public String month; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { MONTH((short)1, "month"); 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: // MONTH return MONTH; 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.MONTH, new libthrift091.meta_data.FieldMetaData("month", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(printDetailBill_args.class, metaDataMap); } public printDetailBill_args() { } public printDetailBill_args( String month) { this(); this.month = month; } /** * Performs a deep copy on <i>other</i>. */ public printDetailBill_args(printDetailBill_args other) { if (other.isSetMonth()) { this.month = other.month; } } public printDetailBill_args deepCopy() { return new printDetailBill_args(this); } @Override public void clear() { this.month = null; } public String getMonth() { return this.month; } public printDetailBill_args setMonth(String month) { this.month = month; return this; } public void unsetMonth() { this.month = null; } /** Returns true if field month is set (has been assigned a value) and false otherwise */ public boolean isSetMonth() { return this.month != null; } public void setMonthIsSet(boolean value) { if (!value) { this.month = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case MONTH: if (value == null) { unsetMonth(); } else { setMonth((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case MONTH: return getMonth(); } 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 MONTH: return isSetMonth(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof printDetailBill_args) return this.equals((printDetailBill_args)that); return false; } public boolean equals(printDetailBill_args that) { if (that == null) return false; boolean this_present_month = true && this.isSetMonth(); boolean that_present_month = true && that.isSetMonth(); if (this_present_month || that_present_month) { if (!(this_present_month && that_present_month)) return false; if (!this.month.equals(that.month)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_month = true && (isSetMonth()); list.add(present_month); if (present_month) list.add(month); return list.hashCode(); } @Override public int compareTo(printDetailBill_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMonth()).compareTo(other.isSetMonth()); if (lastComparison != 0) { return lastComparison; } if (isSetMonth()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.month, other.month); 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("printDetailBill_args("); boolean first = true; sb.append("month:"); if (this.month == null) { sb.append("null"); } else { sb.append(this.month); } 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 printDetailBill_argsStandardSchemeFactory implements SchemeFactory { public printDetailBill_argsStandardScheme getScheme() { return new printDetailBill_argsStandardScheme(); } } private static class printDetailBill_argsStandardScheme extends StandardScheme<printDetailBill_args> { public void read(libthrift091.protocol.TProtocol iprot, printDetailBill_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: // MONTH if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.month = iprot.readString(); struct.setMonthIsSet(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, printDetailBill_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.month != null) { oprot.writeFieldBegin(MONTH_FIELD_DESC); oprot.writeString(struct.month); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class printDetailBill_argsTupleSchemeFactory implements SchemeFactory { public printDetailBill_argsTupleScheme getScheme() { return new printDetailBill_argsTupleScheme(); } } private static class printDetailBill_argsTupleScheme extends TupleScheme<printDetailBill_args> { @Override public void write(libthrift091.protocol.TProtocol prot, printDetailBill_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetMonth()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetMonth()) { oprot.writeString(struct.month); } } @Override public void read(libthrift091.protocol.TProtocol prot, printDetailBill_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.month = iprot.readString(); struct.setMonthIsSet(true); } } } } public static class printDetailBill_result implements libthrift091.TBase<printDetailBill_result, printDetailBill_result._Fields>, java.io.Serializable, Cloneable, Comparable<printDetailBill_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("printDetailBill_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRING, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", 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 printDetailBill_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new printDetailBill_resultTupleSchemeFactory()); } public String success; // required public com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); 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: // SE return SE; 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.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRING))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(printDetailBill_result.class, metaDataMap); } public printDetailBill_result() { } public printDetailBill_result( String success, com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public printDetailBill_result(printDetailBill_result other) { if (other.isSetSuccess()) { this.success = other.success; } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(other.se); } } public printDetailBill_result deepCopy() { return new printDetailBill_result(this); } @Override public void clear() { this.success = null; this.se = null; } public String getSuccess() { return this.success; } public printDetailBill_result setSuccess(String 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 com.xiaomi.infra.galaxy.rpc.thrift.ServiceException getSe() { return this.se; } public printDetailBill_result setSe(com.xiaomi.infra.galaxy.rpc.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((String)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.rpc.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } 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 SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof printDetailBill_result) return this.equals((printDetailBill_result)that); return false; } public boolean equals(printDetailBill_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_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(printDetailBill_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); 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("printDetailBill_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("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } 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 printDetailBill_resultStandardSchemeFactory implements SchemeFactory { public printDetailBill_resultStandardScheme getScheme() { return new printDetailBill_resultStandardScheme(); } } private static class printDetailBill_resultStandardScheme extends StandardScheme<printDetailBill_result> { public void read(libthrift091.protocol.TProtocol iprot, printDetailBill_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 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRING) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(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, printDetailBill_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(struct.success); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class printDetailBill_resultTupleSchemeFactory implements SchemeFactory { public printDetailBill_resultTupleScheme getScheme() { return new printDetailBill_resultTupleScheme(); } } private static class printDetailBill_resultTupleScheme extends TupleScheme<printDetailBill_result> { @Override public void write(libthrift091.protocol.TProtocol prot, printDetailBill_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, printDetailBill_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.rpc.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } }