| |
| /** |
| * Autogenerated by Thrift Compiler (0.11.0) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| package org.apache.dubbo.rpc.protocol.nativethrift; |
| |
| @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) |
| public class DemoService { |
| |
| public interface Iface { |
| |
| String sayHello(String name) throws org.apache.thrift.TException; |
| |
| boolean hasName(boolean hasName) throws org.apache.thrift.TException; |
| |
| String sayHelloTimes(String name, int times) throws org.apache.thrift.TException; |
| |
| void timeOut(int millis) throws org.apache.thrift.TException; |
| |
| String customException() throws org.apache.thrift.TException; |
| |
| String context(String name) throws org.apache.thrift.TException; |
| |
| } |
| |
| public interface AsyncIface { |
| |
| void sayHello(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException; |
| |
| void hasName(boolean hasName, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException; |
| |
| void sayHelloTimes(String name, int times, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException; |
| |
| void timeOut(int millis, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; |
| |
| void customException(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException; |
| |
| void context(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException; |
| |
| } |
| |
| public static class Client extends org.apache.thrift.TServiceClient implements Iface { |
| public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { |
| public Factory() {} |
| public Client getClient(org.apache.thrift.protocol.TProtocol prot) { |
| return new Client(prot); |
| } |
| public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { |
| return new Client(iprot, oprot); |
| } |
| } |
| |
| public Client(org.apache.thrift.protocol.TProtocol prot) |
| { |
| super(prot, prot); |
| } |
| |
| public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { |
| super(iprot, oprot); |
| } |
| |
| public String sayHello(String name) throws org.apache.thrift.TException |
| { |
| send_sayHello(name); |
| return recv_sayHello(); |
| } |
| |
| public void send_sayHello(String name) throws org.apache.thrift.TException |
| { |
| sayHello_args args = new sayHello_args(); |
| args.setName(name); |
| sendBase("sayHello", args); |
| } |
| |
| public String recv_sayHello() throws org.apache.thrift.TException |
| { |
| sayHello_result result = new sayHello_result(); |
| receiveBase(result, "sayHello"); |
| if (result.isSetSuccess()) { |
| return result.success; |
| } |
| throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sayHello failed: unknown result"); |
| } |
| |
| public boolean hasName(boolean hasName) throws org.apache.thrift.TException |
| { |
| send_hasName(hasName); |
| return recv_hasName(); |
| } |
| |
| public void send_hasName(boolean hasName) throws org.apache.thrift.TException |
| { |
| hasName_args args = new hasName_args(); |
| args.setHasName(hasName); |
| sendBase("hasName", args); |
| } |
| |
| public boolean recv_hasName() throws org.apache.thrift.TException |
| { |
| hasName_result result = new hasName_result(); |
| receiveBase(result, "hasName"); |
| if (result.isSetSuccess()) { |
| return result.success; |
| } |
| throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "hasName failed: unknown result"); |
| } |
| |
| public String sayHelloTimes(String name, int times) throws org.apache.thrift.TException |
| { |
| send_sayHelloTimes(name, times); |
| return recv_sayHelloTimes(); |
| } |
| |
| public void send_sayHelloTimes(String name, int times) throws org.apache.thrift.TException |
| { |
| sayHelloTimes_args args = new sayHelloTimes_args(); |
| args.setName(name); |
| args.setTimes(times); |
| sendBase("sayHelloTimes", args); |
| } |
| |
| public String recv_sayHelloTimes() throws org.apache.thrift.TException |
| { |
| sayHelloTimes_result result = new sayHelloTimes_result(); |
| receiveBase(result, "sayHelloTimes"); |
| if (result.isSetSuccess()) { |
| return result.success; |
| } |
| throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sayHelloTimes failed: unknown result"); |
| } |
| |
| public void timeOut(int millis) throws org.apache.thrift.TException |
| { |
| send_timeOut(millis); |
| recv_timeOut(); |
| } |
| |
| public void send_timeOut(int millis) throws org.apache.thrift.TException |
| { |
| timeOut_args args = new timeOut_args(); |
| args.setMillis(millis); |
| sendBase("timeOut", args); |
| } |
| |
| public void recv_timeOut() throws org.apache.thrift.TException |
| { |
| timeOut_result result = new timeOut_result(); |
| receiveBase(result, "timeOut"); |
| return; |
| } |
| |
| public String customException() throws org.apache.thrift.TException |
| { |
| send_customException(); |
| return recv_customException(); |
| } |
| |
| public void send_customException() throws org.apache.thrift.TException |
| { |
| customException_args args = new customException_args(); |
| sendBase("customException", args); |
| } |
| |
| public String recv_customException() throws org.apache.thrift.TException |
| { |
| customException_result result = new customException_result(); |
| receiveBase(result, "customException"); |
| if (result.isSetSuccess()) { |
| return result.success; |
| } |
| throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "customException failed: unknown result"); |
| } |
| |
| public String context(String name) throws org.apache.thrift.TException |
| { |
| send_context(name); |
| return recv_context(); |
| } |
| |
| public void send_context(String name) throws org.apache.thrift.TException |
| { |
| context_args args = new context_args(); |
| args.setName(name); |
| sendBase("context", args); |
| } |
| |
| public String recv_context() throws org.apache.thrift.TException |
| { |
| context_result result = new context_result(); |
| receiveBase(result, "context"); |
| if (result.isSetSuccess()) { |
| return result.success; |
| } |
| throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "context failed: unknown result"); |
| } |
| |
| } |
| public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { |
| public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { |
| private org.apache.thrift.async.TAsyncClientManager clientManager; |
| private org.apache.thrift.protocol.TProtocolFactory protocolFactory; |
| public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { |
| this.clientManager = clientManager; |
| this.protocolFactory = protocolFactory; |
| } |
| public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { |
| return new AsyncClient(protocolFactory, clientManager, transport); |
| } |
| } |
| |
| public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { |
| super(protocolFactory, clientManager, transport); |
| } |
| |
| public void sayHello(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| sayHello_call method_call = new sayHello_call(name, resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class sayHello_call extends org.apache.thrift.async.TAsyncMethodCall<String> { |
| private String name; |
| public sayHello_call(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| this.name = name; |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sayHello", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| sayHello_args args = new sayHello_args(); |
| args.setName(name); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public String getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return (new Client(prot)).recv_sayHello(); |
| } |
| } |
| |
| public void hasName(boolean hasName, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| hasName_call method_call = new hasName_call(hasName, resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class hasName_call extends org.apache.thrift.async.TAsyncMethodCall<Boolean> { |
| private boolean hasName; |
| public hasName_call(boolean hasName, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| this.hasName = hasName; |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("hasName", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| hasName_args args = new hasName_args(); |
| args.setHasName(hasName); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public Boolean getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return (new Client(prot)).recv_hasName(); |
| } |
| } |
| |
| public void sayHelloTimes(String name, int times, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| sayHelloTimes_call method_call = new sayHelloTimes_call(name, times, resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class sayHelloTimes_call extends org.apache.thrift.async.TAsyncMethodCall<String> { |
| private String name; |
| private int times; |
| public sayHelloTimes_call(String name, int times, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| this.name = name; |
| this.times = times; |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sayHelloTimes", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| sayHelloTimes_args args = new sayHelloTimes_args(); |
| args.setName(name); |
| args.setTimes(times); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public String getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return (new Client(prot)).recv_sayHelloTimes(); |
| } |
| } |
| |
| public void timeOut(int millis, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| timeOut_call method_call = new timeOut_call(millis, resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class timeOut_call extends org.apache.thrift.async.TAsyncMethodCall<Void> { |
| private int millis; |
| public timeOut_call(int millis, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| this.millis = millis; |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("timeOut", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| timeOut_args args = new timeOut_args(); |
| args.setMillis(millis); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public Void getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return null; |
| } |
| } |
| |
| public void customException(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| customException_call method_call = new customException_call(resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class customException_call extends org.apache.thrift.async.TAsyncMethodCall<String> { |
| public customException_call(org.apache.thrift.async.AsyncMethodCallback<String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("customException", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| customException_args args = new customException_args(); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public String getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return (new Client(prot)).recv_customException(); |
| } |
| } |
| |
| public void context(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| checkReady(); |
| context_call method_call = new context_call(name, resultHandler, this, ___protocolFactory, ___transport); |
| this.___currentMethod = method_call; |
| ___manager.call(method_call); |
| } |
| |
| public static class context_call extends org.apache.thrift.async.TAsyncMethodCall<String> { |
| private String name; |
| public context_call(String name, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { |
| super(client, protocolFactory, transport, resultHandler, false); |
| this.name = name; |
| } |
| |
| public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { |
| prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("context", org.apache.thrift.protocol.TMessageType.CALL, 0)); |
| context_args args = new context_args(); |
| args.setName(name); |
| args.write(prot); |
| prot.writeMessageEnd(); |
| } |
| |
| public String getResult() throws org.apache.thrift.TException { |
| if (getState() != State.RESPONSE_READ) { |
| throw new IllegalStateException("Method call not finished!"); |
| } |
| org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); |
| org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); |
| return (new Client(prot)).recv_context(); |
| } |
| } |
| |
| } |
| |
| public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { |
| private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); |
| public Processor(I iface) { |
| super(iface, getProcessMap(new java.util.HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); |
| } |
| |
| protected Processor(I iface, java.util.Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { |
| super(iface, getProcessMap(processMap)); |
| } |
| |
| private static <I extends Iface> java.util.Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { |
| processMap.put("sayHello", new sayHello()); |
| processMap.put("hasName", new hasName()); |
| processMap.put("sayHelloTimes", new sayHelloTimes()); |
| processMap.put("timeOut", new timeOut()); |
| processMap.put("customException", new customException()); |
| processMap.put("context", new context()); |
| return processMap; |
| } |
| |
| public static class sayHello<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sayHello_args> { |
| public sayHello() { |
| super("sayHello"); |
| } |
| |
| public sayHello_args getEmptyArgsInstance() { |
| return new sayHello_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public sayHello_result getResult(I iface, sayHello_args args) throws org.apache.thrift.TException { |
| sayHello_result result = new sayHello_result(); |
| result.success = iface.sayHello(args.name); |
| return result; |
| } |
| } |
| |
| public static class hasName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, hasName_args> { |
| public hasName() { |
| super("hasName"); |
| } |
| |
| public hasName_args getEmptyArgsInstance() { |
| return new hasName_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public hasName_result getResult(I iface, hasName_args args) throws org.apache.thrift.TException { |
| hasName_result result = new hasName_result(); |
| result.success = iface.hasName(args.hasName); |
| result.setSuccessIsSet(true); |
| return result; |
| } |
| } |
| |
| public static class sayHelloTimes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sayHelloTimes_args> { |
| public sayHelloTimes() { |
| super("sayHelloTimes"); |
| } |
| |
| public sayHelloTimes_args getEmptyArgsInstance() { |
| return new sayHelloTimes_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public sayHelloTimes_result getResult(I iface, sayHelloTimes_args args) throws org.apache.thrift.TException { |
| sayHelloTimes_result result = new sayHelloTimes_result(); |
| result.success = iface.sayHelloTimes(args.name, args.times); |
| return result; |
| } |
| } |
| |
| public static class timeOut<I extends Iface> extends org.apache.thrift.ProcessFunction<I, timeOut_args> { |
| public timeOut() { |
| super("timeOut"); |
| } |
| |
| public timeOut_args getEmptyArgsInstance() { |
| return new timeOut_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public timeOut_result getResult(I iface, timeOut_args args) throws org.apache.thrift.TException { |
| timeOut_result result = new timeOut_result(); |
| iface.timeOut(args.millis); |
| return result; |
| } |
| } |
| |
| public static class customException<I extends Iface> extends org.apache.thrift.ProcessFunction<I, customException_args> { |
| public customException() { |
| super("customException"); |
| } |
| |
| public customException_args getEmptyArgsInstance() { |
| return new customException_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public customException_result getResult(I iface, customException_args args) throws org.apache.thrift.TException { |
| customException_result result = new customException_result(); |
| result.success = iface.customException(); |
| return result; |
| } |
| } |
| |
| public static class context<I extends Iface> extends org.apache.thrift.ProcessFunction<I, context_args> { |
| public context() { |
| super("context"); |
| } |
| |
| public context_args getEmptyArgsInstance() { |
| return new context_args(); |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| protected boolean handleRuntimeExceptions() { |
| return false; |
| } |
| |
| public context_result getResult(I iface, context_args args) throws org.apache.thrift.TException { |
| context_result result = new context_result(); |
| result.success = iface.context(args.name); |
| return result; |
| } |
| } |
| |
| } |
| |
| public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { |
| private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); |
| public AsyncProcessor(I iface) { |
| super(iface, getProcessMap(new java.util.HashMap<>())); |
| } |
| |
| protected AsyncProcessor(I iface, java.util.Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { |
| super(iface, getProcessMap(processMap)); |
| } |
| |
| private static <I extends AsyncIface> java.util.Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { |
| processMap.put("sayHello", new sayHello()); |
| processMap.put("hasName", new hasName()); |
| processMap.put("sayHelloTimes", new sayHelloTimes()); |
| processMap.put("timeOut", new timeOut()); |
| processMap.put("customException", new customException()); |
| processMap.put("context", new context()); |
| return processMap; |
| } |
| |
| public static class sayHello<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sayHello_args, String> { |
| public sayHello() { |
| super("sayHello"); |
| } |
| |
| public sayHello_args getEmptyArgsInstance() { |
| return new sayHello_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<String>() { |
| public void onComplete(String o) { |
| sayHello_result result = new sayHello_result(); |
| result.success = o; |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| sayHello_result result = new sayHello_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, sayHello_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| iface.sayHello(args.name,resultHandler); |
| } |
| } |
| |
| public static class hasName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, hasName_args, Boolean> { |
| public hasName() { |
| super("hasName"); |
| } |
| |
| public hasName_args getEmptyArgsInstance() { |
| return new hasName_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<Boolean>() { |
| public void onComplete(Boolean o) { |
| hasName_result result = new hasName_result(); |
| result.success = o; |
| result.setSuccessIsSet(true); |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| hasName_result result = new hasName_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, hasName_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws org.apache.thrift.TException { |
| iface.hasName(args.hasName,resultHandler); |
| } |
| } |
| |
| public static class sayHelloTimes<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sayHelloTimes_args, String> { |
| public sayHelloTimes() { |
| super("sayHelloTimes"); |
| } |
| |
| public sayHelloTimes_args getEmptyArgsInstance() { |
| return new sayHelloTimes_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<String>() { |
| public void onComplete(String o) { |
| sayHelloTimes_result result = new sayHelloTimes_result(); |
| result.success = o; |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| sayHelloTimes_result result = new sayHelloTimes_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, sayHelloTimes_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| iface.sayHelloTimes(args.name, args.times,resultHandler); |
| } |
| } |
| |
| public static class timeOut<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, timeOut_args, Void> { |
| public timeOut() { |
| super("timeOut"); |
| } |
| |
| public timeOut_args getEmptyArgsInstance() { |
| return new timeOut_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<Void> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<Void>() { |
| public void onComplete(Void o) { |
| timeOut_result result = new timeOut_result(); |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| timeOut_result result = new timeOut_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, timeOut_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { |
| iface.timeOut(args.millis,resultHandler); |
| } |
| } |
| |
| public static class customException<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, customException_args, String> { |
| public customException() { |
| super("customException"); |
| } |
| |
| public customException_args getEmptyArgsInstance() { |
| return new customException_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<String>() { |
| public void onComplete(String o) { |
| customException_result result = new customException_result(); |
| result.success = o; |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| customException_result result = new customException_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, customException_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| iface.customException(resultHandler); |
| } |
| } |
| |
| public static class context<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, context_args, String> { |
| public context() { |
| super("context"); |
| } |
| |
| public context_args getEmptyArgsInstance() { |
| return new context_args(); |
| } |
| |
| public org.apache.thrift.async.AsyncMethodCallback<String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { |
| final org.apache.thrift.AsyncProcessFunction fcall = this; |
| return new org.apache.thrift.async.AsyncMethodCallback<String>() { |
| public void onComplete(String o) { |
| context_result result = new context_result(); |
| result.success = o; |
| try { |
| fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); |
| } catch (org.apache.thrift.transport.TTransportException e) { |
| _LOGGER.error("TTransportException writing to internal frame buffer", e); |
| fb.close(); |
| } catch (Exception e) { |
| _LOGGER.error("Exception writing to internal frame buffer", e); |
| onError(e); |
| } |
| } |
| public void onError(Exception e) { |
| byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; |
| org.apache.thrift.TSerializable msg; |
| context_result result = new context_result(); |
| if (e instanceof org.apache.thrift.transport.TTransportException) { |
| _LOGGER.error("TTransportException inside handler", e); |
| fb.close(); |
| return; |
| } else if (e instanceof org.apache.thrift.TApplicationException) { |
| _LOGGER.error("TApplicationException inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = (org.apache.thrift.TApplicationException)e; |
| } else { |
| _LOGGER.error("Exception inside handler", e); |
| msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; |
| msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); |
| } |
| try { |
| fcall.sendResponse(fb,msg,msgType,seqid); |
| } catch (Exception ex) { |
| _LOGGER.error("Exception writing to internal frame buffer", ex); |
| fb.close(); |
| } |
| } |
| }; |
| } |
| |
| protected boolean isOneway() { |
| return false; |
| } |
| |
| public void start(I iface, context_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws org.apache.thrift.TException { |
| iface.context(args.name,resultHandler); |
| } |
| } |
| |
| } |
| |
| public static class sayHello_args implements org.apache.thrift.TBase<sayHello_args, sayHello_args._Fields>, java.io.Serializable, Cloneable, Comparable<sayHello_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sayHello_args"); |
| |
| private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new sayHello_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new sayHello_argsTupleSchemeFactory(); |
| |
| public String name; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| NAME((short)1, "name"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // NAME |
| return NAME; |
| 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 java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sayHello_args.class, metaDataMap); |
| } |
| |
| public sayHello_args() { |
| } |
| |
| public sayHello_args( |
| String name) |
| { |
| this(); |
| this.name = name; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public sayHello_args(sayHello_args other) { |
| if (other.isSetName()) { |
| this.name = other.name; |
| } |
| } |
| |
| public sayHello_args deepCopy() { |
| return new sayHello_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.name = null; |
| } |
| |
| public String getName() { |
| return this.name; |
| } |
| |
| public sayHello_args setName(String name) { |
| this.name = name; |
| return this; |
| } |
| |
| public void unsetName() { |
| this.name = null; |
| } |
| |
| /** Returns true if field name is set (has been assigned a value) and false otherwise */ |
| public boolean isSetName() { |
| return this.name != null; |
| } |
| |
| public void setNameIsSet(boolean value) { |
| if (!value) { |
| this.name = null; |
| } |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case NAME: |
| if (value == null) { |
| unsetName(); |
| } else { |
| setName((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case NAME: |
| return getName(); |
| |
| } |
| 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 NAME: |
| return isSetName(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof sayHello_args) |
| return this.equals((sayHello_args)that); |
| return false; |
| } |
| |
| public boolean equals(sayHello_args that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_name = true && this.isSetName(); |
| boolean that_present_name = true && that.isSetName(); |
| if (this_present_name || that_present_name) { |
| if (!(this_present_name && that_present_name)) |
| return false; |
| if (!this.name.equals(that.name)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); |
| if (isSetName()) |
| hashCode = hashCode * 8191 + name.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(sayHello_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetName()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("sayHello_args("); |
| boolean first = true; |
| |
| sb.append("name:"); |
| if (this.name == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.name); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (name == null) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); |
| } |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class sayHello_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHello_argsStandardScheme getScheme() { |
| return new sayHello_argsStandardScheme(); |
| } |
| } |
| |
| private static class sayHello_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<sayHello_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, sayHello_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // NAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, sayHello_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.name != null) { |
| oprot.writeFieldBegin(NAME_FIELD_DESC); |
| oprot.writeString(struct.name); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class sayHello_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHello_argsTupleScheme getScheme() { |
| return new sayHello_argsTupleScheme(); |
| } |
| } |
| |
| private static class sayHello_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<sayHello_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, sayHello_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeString(struct.name); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, sayHello_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class sayHello_result implements org.apache.thrift.TBase<sayHello_result, sayHello_result._Fields>, java.io.Serializable, Cloneable, Comparable<sayHello_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sayHello_result"); |
| |
| private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new sayHello_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new sayHello_resultTupleSchemeFactory(); |
| |
| public String success; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| SUCCESS((short)0, "success"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 0: // SUCCESS |
| return SUCCESS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sayHello_result.class, metaDataMap); |
| } |
| |
| public sayHello_result() { |
| } |
| |
| public sayHello_result( |
| String success) |
| { |
| this(); |
| this.success = success; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public sayHello_result(sayHello_result other) { |
| if (other.isSetSuccess()) { |
| this.success = other.success; |
| } |
| } |
| |
| public sayHello_result deepCopy() { |
| return new sayHello_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.success = null; |
| } |
| |
| public String getSuccess() { |
| return this.success; |
| } |
| |
| public sayHello_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 void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case SUCCESS: |
| if (value == null) { |
| unsetSuccess(); |
| } else { |
| setSuccess((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case SUCCESS: |
| return getSuccess(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case SUCCESS: |
| return isSetSuccess(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof sayHello_result) |
| return this.equals((sayHello_result)that); |
| return false; |
| } |
| |
| public boolean equals(sayHello_result that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_success = true && this.isSetSuccess(); |
| boolean that_present_success = true && that.isSetSuccess(); |
| if (this_present_success || that_present_success) { |
| if (!(this_present_success && that_present_success)) |
| return false; |
| if (!this.success.equals(that.success)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); |
| if (isSetSuccess()) |
| hashCode = hashCode * 8191 + success.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(sayHello_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetSuccess()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("sayHello_result("); |
| boolean first = true; |
| |
| sb.append("success:"); |
| if (this.success == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.success); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class sayHello_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHello_resultStandardScheme getScheme() { |
| return new sayHello_resultStandardScheme(); |
| } |
| } |
| |
| private static class sayHello_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<sayHello_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, sayHello_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 0: // SUCCESS |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, sayHello_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.success != null) { |
| oprot.writeFieldBegin(SUCCESS_FIELD_DESC); |
| oprot.writeString(struct.success); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class sayHello_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHello_resultTupleScheme getScheme() { |
| return new sayHello_resultTupleScheme(); |
| } |
| } |
| |
| private static class sayHello_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<sayHello_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, sayHello_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetSuccess()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetSuccess()) { |
| oprot.writeString(struct.success); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, sayHello_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet incoming = iprot.readBitSet(1); |
| if (incoming.get(0)) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class hasName_args implements org.apache.thrift.TBase<hasName_args, hasName_args._Fields>, java.io.Serializable, Cloneable, Comparable<hasName_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("hasName_args"); |
| |
| private static final org.apache.thrift.protocol.TField HAS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hasName", org.apache.thrift.protocol.TType.BOOL, (short)1); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new hasName_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new hasName_argsTupleSchemeFactory(); |
| |
| public boolean hasName; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| HAS_NAME((short)1, "hasName"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // HAS_NAME |
| return HAS_NAME; |
| 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 __HASNAME_ISSET_ID = 0; |
| private byte __isset_bitfield = 0; |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.HAS_NAME, new org.apache.thrift.meta_data.FieldMetaData("hasName", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(hasName_args.class, metaDataMap); |
| } |
| |
| public hasName_args() { |
| } |
| |
| public hasName_args( |
| boolean hasName) |
| { |
| this(); |
| this.hasName = hasName; |
| setHasNameIsSet(true); |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public hasName_args(hasName_args other) { |
| __isset_bitfield = other.__isset_bitfield; |
| this.hasName = other.hasName; |
| } |
| |
| public hasName_args deepCopy() { |
| return new hasName_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| setHasNameIsSet(false); |
| this.hasName = false; |
| } |
| |
| public boolean isHasName() { |
| return this.hasName; |
| } |
| |
| public hasName_args setHasName(boolean hasName) { |
| this.hasName = hasName; |
| setHasNameIsSet(true); |
| return this; |
| } |
| |
| public void unsetHasName() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASNAME_ISSET_ID); |
| } |
| |
| /** Returns true if field hasName is set (has been assigned a value) and false otherwise */ |
| public boolean isSetHasName() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASNAME_ISSET_ID); |
| } |
| |
| public void setHasNameIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASNAME_ISSET_ID, value); |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case HAS_NAME: |
| if (value == null) { |
| unsetHasName(); |
| } else { |
| setHasName((Boolean)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case HAS_NAME: |
| return isHasName(); |
| |
| } |
| 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 HAS_NAME: |
| return isSetHasName(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof hasName_args) |
| return this.equals((hasName_args)that); |
| return false; |
| } |
| |
| public boolean equals(hasName_args that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_hasName = true; |
| boolean that_present_hasName = true; |
| if (this_present_hasName || that_present_hasName) { |
| if (!(this_present_hasName && that_present_hasName)) |
| return false; |
| if (this.hasName != that.hasName) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((hasName) ? 131071 : 524287); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(hasName_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetHasName()).compareTo(other.isSetHasName()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetHasName()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasName, other.hasName); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("hasName_args("); |
| boolean first = true; |
| |
| sb.append("hasName:"); |
| sb.append(this.hasName); |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // alas, we cannot check 'hasName' because it's a primitive and you chose the non-beans generator. |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. |
| __isset_bitfield = 0; |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class hasName_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public hasName_argsStandardScheme getScheme() { |
| return new hasName_argsStandardScheme(); |
| } |
| } |
| |
| private static class hasName_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<hasName_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, hasName_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // HAS_NAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { |
| struct.hasName = iprot.readBool(); |
| struct.setHasNameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| if (!struct.isSetHasName()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasName' was not found in serialized data! Struct: " + toString()); |
| } |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, hasName_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| oprot.writeFieldBegin(HAS_NAME_FIELD_DESC); |
| oprot.writeBool(struct.hasName); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class hasName_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public hasName_argsTupleScheme getScheme() { |
| return new hasName_argsTupleScheme(); |
| } |
| } |
| |
| private static class hasName_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<hasName_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, hasName_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeBool(struct.hasName); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, hasName_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.hasName = iprot.readBool(); |
| struct.setHasNameIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class hasName_result implements org.apache.thrift.TBase<hasName_result, hasName_result._Fields>, java.io.Serializable, Cloneable, Comparable<hasName_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("hasName_result"); |
| |
| private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new hasName_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new hasName_resultTupleSchemeFactory(); |
| |
| public boolean success; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| SUCCESS((short)0, "success"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 0: // SUCCESS |
| return SUCCESS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| private static final int __SUCCESS_ISSET_ID = 0; |
| private byte __isset_bitfield = 0; |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(hasName_result.class, metaDataMap); |
| } |
| |
| public hasName_result() { |
| } |
| |
| public hasName_result( |
| boolean success) |
| { |
| this(); |
| this.success = success; |
| setSuccessIsSet(true); |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public hasName_result(hasName_result other) { |
| __isset_bitfield = other.__isset_bitfield; |
| this.success = other.success; |
| } |
| |
| public hasName_result deepCopy() { |
| return new hasName_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| setSuccessIsSet(false); |
| this.success = false; |
| } |
| |
| public boolean isSuccess() { |
| return this.success; |
| } |
| |
| public hasName_result setSuccess(boolean success) { |
| this.success = success; |
| setSuccessIsSet(true); |
| return this; |
| } |
| |
| public void unsetSuccess() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); |
| } |
| |
| /** Returns true if field success is set (has been assigned a value) and false otherwise */ |
| public boolean isSetSuccess() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); |
| } |
| |
| public void setSuccessIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case SUCCESS: |
| if (value == null) { |
| unsetSuccess(); |
| } else { |
| setSuccess((Boolean)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case SUCCESS: |
| return isSuccess(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case SUCCESS: |
| return isSetSuccess(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof hasName_result) |
| return this.equals((hasName_result)that); |
| return false; |
| } |
| |
| public boolean equals(hasName_result that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_success = true; |
| boolean that_present_success = true; |
| if (this_present_success || that_present_success) { |
| if (!(this_present_success && that_present_success)) |
| return false; |
| if (this.success != that.success) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(hasName_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetSuccess()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("hasName_result("); |
| boolean first = true; |
| |
| sb.append("success:"); |
| sb.append(this.success); |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. |
| __isset_bitfield = 0; |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class hasName_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public hasName_resultStandardScheme getScheme() { |
| return new hasName_resultStandardScheme(); |
| } |
| } |
| |
| private static class hasName_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<hasName_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, hasName_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 0: // SUCCESS |
| if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { |
| struct.success = iprot.readBool(); |
| struct.setSuccessIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, hasName_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.isSetSuccess()) { |
| oprot.writeFieldBegin(SUCCESS_FIELD_DESC); |
| oprot.writeBool(struct.success); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class hasName_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public hasName_resultTupleScheme getScheme() { |
| return new hasName_resultTupleScheme(); |
| } |
| } |
| |
| private static class hasName_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<hasName_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, hasName_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetSuccess()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetSuccess()) { |
| oprot.writeBool(struct.success); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, hasName_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet incoming = iprot.readBitSet(1); |
| if (incoming.get(0)) { |
| struct.success = iprot.readBool(); |
| struct.setSuccessIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class sayHelloTimes_args implements org.apache.thrift.TBase<sayHelloTimes_args, sayHelloTimes_args._Fields>, java.io.Serializable, Cloneable, Comparable<sayHelloTimes_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sayHelloTimes_args"); |
| |
| private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); |
| private static final org.apache.thrift.protocol.TField TIMES_FIELD_DESC = new org.apache.thrift.protocol.TField("times", org.apache.thrift.protocol.TType.I32, (short)2); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new sayHelloTimes_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new sayHelloTimes_argsTupleSchemeFactory(); |
| |
| public String name; // required |
| public int times; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| NAME((short)1, "name"), |
| TIMES((short)2, "times"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // NAME |
| return NAME; |
| case 2: // TIMES |
| return TIMES; |
| 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 __TIMES_ISSET_ID = 0; |
| private byte __isset_bitfield = 0; |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.TIMES, new org.apache.thrift.meta_data.FieldMetaData("times", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sayHelloTimes_args.class, metaDataMap); |
| } |
| |
| public sayHelloTimes_args() { |
| } |
| |
| public sayHelloTimes_args( |
| String name, |
| int times) |
| { |
| this(); |
| this.name = name; |
| this.times = times; |
| setTimesIsSet(true); |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public sayHelloTimes_args(sayHelloTimes_args other) { |
| __isset_bitfield = other.__isset_bitfield; |
| if (other.isSetName()) { |
| this.name = other.name; |
| } |
| this.times = other.times; |
| } |
| |
| public sayHelloTimes_args deepCopy() { |
| return new sayHelloTimes_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.name = null; |
| setTimesIsSet(false); |
| this.times = 0; |
| } |
| |
| public String getName() { |
| return this.name; |
| } |
| |
| public sayHelloTimes_args setName(String name) { |
| this.name = name; |
| return this; |
| } |
| |
| public void unsetName() { |
| this.name = null; |
| } |
| |
| /** Returns true if field name is set (has been assigned a value) and false otherwise */ |
| public boolean isSetName() { |
| return this.name != null; |
| } |
| |
| public void setNameIsSet(boolean value) { |
| if (!value) { |
| this.name = null; |
| } |
| } |
| |
| public int getTimes() { |
| return this.times; |
| } |
| |
| public sayHelloTimes_args setTimes(int times) { |
| this.times = times; |
| setTimesIsSet(true); |
| return this; |
| } |
| |
| public void unsetTimes() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMES_ISSET_ID); |
| } |
| |
| /** Returns true if field times is set (has been assigned a value) and false otherwise */ |
| public boolean isSetTimes() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMES_ISSET_ID); |
| } |
| |
| public void setTimesIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMES_ISSET_ID, value); |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case NAME: |
| if (value == null) { |
| unsetName(); |
| } else { |
| setName((String)value); |
| } |
| break; |
| |
| case TIMES: |
| if (value == null) { |
| unsetTimes(); |
| } else { |
| setTimes((Integer)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case NAME: |
| return getName(); |
| |
| case TIMES: |
| return getTimes(); |
| |
| } |
| 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 NAME: |
| return isSetName(); |
| case TIMES: |
| return isSetTimes(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof sayHelloTimes_args) |
| return this.equals((sayHelloTimes_args)that); |
| return false; |
| } |
| |
| public boolean equals(sayHelloTimes_args that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_name = true && this.isSetName(); |
| boolean that_present_name = true && that.isSetName(); |
| if (this_present_name || that_present_name) { |
| if (!(this_present_name && that_present_name)) |
| return false; |
| if (!this.name.equals(that.name)) |
| return false; |
| } |
| |
| boolean this_present_times = true; |
| boolean that_present_times = true; |
| if (this_present_times || that_present_times) { |
| if (!(this_present_times && that_present_times)) |
| return false; |
| if (this.times != that.times) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); |
| if (isSetName()) |
| hashCode = hashCode * 8191 + name.hashCode(); |
| |
| hashCode = hashCode * 8191 + times; |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(sayHelloTimes_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetName()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(isSetTimes()).compareTo(other.isSetTimes()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetTimes()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.times, other.times); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("sayHelloTimes_args("); |
| boolean first = true; |
| |
| sb.append("name:"); |
| if (this.name == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.name); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("times:"); |
| sb.append(this.times); |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (name == null) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); |
| } |
| // alas, we cannot check 'times' because it's a primitive and you chose the non-beans generator. |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. |
| __isset_bitfield = 0; |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class sayHelloTimes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHelloTimes_argsStandardScheme getScheme() { |
| return new sayHelloTimes_argsStandardScheme(); |
| } |
| } |
| |
| private static class sayHelloTimes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<sayHelloTimes_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, sayHelloTimes_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // NAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // TIMES |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.times = iprot.readI32(); |
| struct.setTimesIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| if (!struct.isSetTimes()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'times' was not found in serialized data! Struct: " + toString()); |
| } |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, sayHelloTimes_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.name != null) { |
| oprot.writeFieldBegin(NAME_FIELD_DESC); |
| oprot.writeString(struct.name); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldBegin(TIMES_FIELD_DESC); |
| oprot.writeI32(struct.times); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class sayHelloTimes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHelloTimes_argsTupleScheme getScheme() { |
| return new sayHelloTimes_argsTupleScheme(); |
| } |
| } |
| |
| private static class sayHelloTimes_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<sayHelloTimes_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, sayHelloTimes_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeString(struct.name); |
| oprot.writeI32(struct.times); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, sayHelloTimes_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| struct.times = iprot.readI32(); |
| struct.setTimesIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class sayHelloTimes_result implements org.apache.thrift.TBase<sayHelloTimes_result, sayHelloTimes_result._Fields>, java.io.Serializable, Cloneable, Comparable<sayHelloTimes_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sayHelloTimes_result"); |
| |
| private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new sayHelloTimes_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new sayHelloTimes_resultTupleSchemeFactory(); |
| |
| public String success; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| SUCCESS((short)0, "success"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 0: // SUCCESS |
| return SUCCESS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sayHelloTimes_result.class, metaDataMap); |
| } |
| |
| public sayHelloTimes_result() { |
| } |
| |
| public sayHelloTimes_result( |
| String success) |
| { |
| this(); |
| this.success = success; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public sayHelloTimes_result(sayHelloTimes_result other) { |
| if (other.isSetSuccess()) { |
| this.success = other.success; |
| } |
| } |
| |
| public sayHelloTimes_result deepCopy() { |
| return new sayHelloTimes_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.success = null; |
| } |
| |
| public String getSuccess() { |
| return this.success; |
| } |
| |
| public sayHelloTimes_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 void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case SUCCESS: |
| if (value == null) { |
| unsetSuccess(); |
| } else { |
| setSuccess((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case SUCCESS: |
| return getSuccess(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case SUCCESS: |
| return isSetSuccess(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof sayHelloTimes_result) |
| return this.equals((sayHelloTimes_result)that); |
| return false; |
| } |
| |
| public boolean equals(sayHelloTimes_result that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_success = true && this.isSetSuccess(); |
| boolean that_present_success = true && that.isSetSuccess(); |
| if (this_present_success || that_present_success) { |
| if (!(this_present_success && that_present_success)) |
| return false; |
| if (!this.success.equals(that.success)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); |
| if (isSetSuccess()) |
| hashCode = hashCode * 8191 + success.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(sayHelloTimes_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetSuccess()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("sayHelloTimes_result("); |
| boolean first = true; |
| |
| sb.append("success:"); |
| if (this.success == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.success); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class sayHelloTimes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHelloTimes_resultStandardScheme getScheme() { |
| return new sayHelloTimes_resultStandardScheme(); |
| } |
| } |
| |
| private static class sayHelloTimes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<sayHelloTimes_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, sayHelloTimes_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 0: // SUCCESS |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, sayHelloTimes_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.success != null) { |
| oprot.writeFieldBegin(SUCCESS_FIELD_DESC); |
| oprot.writeString(struct.success); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class sayHelloTimes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public sayHelloTimes_resultTupleScheme getScheme() { |
| return new sayHelloTimes_resultTupleScheme(); |
| } |
| } |
| |
| private static class sayHelloTimes_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<sayHelloTimes_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, sayHelloTimes_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetSuccess()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetSuccess()) { |
| oprot.writeString(struct.success); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, sayHelloTimes_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet incoming = iprot.readBitSet(1); |
| if (incoming.get(0)) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class timeOut_args implements org.apache.thrift.TBase<timeOut_args, timeOut_args._Fields>, java.io.Serializable, Cloneable, Comparable<timeOut_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("timeOut_args"); |
| |
| private static final org.apache.thrift.protocol.TField MILLIS_FIELD_DESC = new org.apache.thrift.protocol.TField("millis", org.apache.thrift.protocol.TType.I32, (short)1); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timeOut_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timeOut_argsTupleSchemeFactory(); |
| |
| public int millis; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| MILLIS((short)1, "millis"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // MILLIS |
| return MILLIS; |
| 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 __MILLIS_ISSET_ID = 0; |
| private byte __isset_bitfield = 0; |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.MILLIS, new org.apache.thrift.meta_data.FieldMetaData("millis", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timeOut_args.class, metaDataMap); |
| } |
| |
| public timeOut_args() { |
| } |
| |
| public timeOut_args( |
| int millis) |
| { |
| this(); |
| this.millis = millis; |
| setMillisIsSet(true); |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public timeOut_args(timeOut_args other) { |
| __isset_bitfield = other.__isset_bitfield; |
| this.millis = other.millis; |
| } |
| |
| public timeOut_args deepCopy() { |
| return new timeOut_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| setMillisIsSet(false); |
| this.millis = 0; |
| } |
| |
| public int getMillis() { |
| return this.millis; |
| } |
| |
| public timeOut_args setMillis(int millis) { |
| this.millis = millis; |
| setMillisIsSet(true); |
| return this; |
| } |
| |
| public void unsetMillis() { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MILLIS_ISSET_ID); |
| } |
| |
| /** Returns true if field millis is set (has been assigned a value) and false otherwise */ |
| public boolean isSetMillis() { |
| return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MILLIS_ISSET_ID); |
| } |
| |
| public void setMillisIsSet(boolean value) { |
| __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MILLIS_ISSET_ID, value); |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case MILLIS: |
| if (value == null) { |
| unsetMillis(); |
| } else { |
| setMillis((Integer)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case MILLIS: |
| return getMillis(); |
| |
| } |
| 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 MILLIS: |
| return isSetMillis(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof timeOut_args) |
| return this.equals((timeOut_args)that); |
| return false; |
| } |
| |
| public boolean equals(timeOut_args that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_millis = true; |
| boolean that_present_millis = true; |
| if (this_present_millis || that_present_millis) { |
| if (!(this_present_millis && that_present_millis)) |
| return false; |
| if (this.millis != that.millis) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + millis; |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(timeOut_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetMillis()).compareTo(other.isSetMillis()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetMillis()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.millis, other.millis); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("timeOut_args("); |
| boolean first = true; |
| |
| sb.append("millis:"); |
| sb.append(this.millis); |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // alas, we cannot check 'millis' because it's a primitive and you chose the non-beans generator. |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. |
| __isset_bitfield = 0; |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class timeOut_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public timeOut_argsStandardScheme getScheme() { |
| return new timeOut_argsStandardScheme(); |
| } |
| } |
| |
| private static class timeOut_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<timeOut_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, timeOut_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // MILLIS |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.millis = iprot.readI32(); |
| struct.setMillisIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| if (!struct.isSetMillis()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'millis' was not found in serialized data! Struct: " + toString()); |
| } |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, timeOut_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| oprot.writeFieldBegin(MILLIS_FIELD_DESC); |
| oprot.writeI32(struct.millis); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class timeOut_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public timeOut_argsTupleScheme getScheme() { |
| return new timeOut_argsTupleScheme(); |
| } |
| } |
| |
| private static class timeOut_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<timeOut_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, timeOut_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeI32(struct.millis); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, timeOut_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.millis = iprot.readI32(); |
| struct.setMillisIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class timeOut_result implements org.apache.thrift.TBase<timeOut_result, timeOut_result._Fields>, java.io.Serializable, Cloneable, Comparable<timeOut_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("timeOut_result"); |
| |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new timeOut_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new timeOut_resultTupleSchemeFactory(); |
| |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| ; |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(timeOut_result.class, metaDataMap); |
| } |
| |
| public timeOut_result() { |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public timeOut_result(timeOut_result other) { |
| } |
| |
| public timeOut_result deepCopy() { |
| return new timeOut_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof timeOut_result) |
| return this.equals((timeOut_result)that); |
| return false; |
| } |
| |
| public boolean equals(timeOut_result that) { |
| if (that == null) |
| return false; |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(timeOut_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("timeOut_result("); |
| boolean first = true; |
| |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class timeOut_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public timeOut_resultStandardScheme getScheme() { |
| return new timeOut_resultStandardScheme(); |
| } |
| } |
| |
| private static class timeOut_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<timeOut_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, timeOut_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, timeOut_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class timeOut_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public timeOut_resultTupleScheme getScheme() { |
| return new timeOut_resultTupleScheme(); |
| } |
| } |
| |
| private static class timeOut_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<timeOut_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, timeOut_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, timeOut_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class customException_args implements org.apache.thrift.TBase<customException_args, customException_args._Fields>, java.io.Serializable, Cloneable, Comparable<customException_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("customException_args"); |
| |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new customException_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new customException_argsTupleSchemeFactory(); |
| |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| ; |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(customException_args.class, metaDataMap); |
| } |
| |
| public customException_args() { |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public customException_args(customException_args other) { |
| } |
| |
| public customException_args deepCopy() { |
| return new customException_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof customException_args) |
| return this.equals((customException_args)that); |
| return false; |
| } |
| |
| public boolean equals(customException_args that) { |
| if (that == null) |
| return false; |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(customException_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("customException_args("); |
| boolean first = true; |
| |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class customException_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public customException_argsStandardScheme getScheme() { |
| return new customException_argsStandardScheme(); |
| } |
| } |
| |
| private static class customException_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<customException_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, customException_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, customException_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class customException_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public customException_argsTupleScheme getScheme() { |
| return new customException_argsTupleScheme(); |
| } |
| } |
| |
| private static class customException_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<customException_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, customException_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, customException_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class customException_result implements org.apache.thrift.TBase<customException_result, customException_result._Fields>, java.io.Serializable, Cloneable, Comparable<customException_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("customException_result"); |
| |
| private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new customException_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new customException_resultTupleSchemeFactory(); |
| |
| public String success; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| SUCCESS((short)0, "success"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 0: // SUCCESS |
| return SUCCESS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(customException_result.class, metaDataMap); |
| } |
| |
| public customException_result() { |
| } |
| |
| public customException_result( |
| String success) |
| { |
| this(); |
| this.success = success; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public customException_result(customException_result other) { |
| if (other.isSetSuccess()) { |
| this.success = other.success; |
| } |
| } |
| |
| public customException_result deepCopy() { |
| return new customException_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.success = null; |
| } |
| |
| public String getSuccess() { |
| return this.success; |
| } |
| |
| public customException_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 void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case SUCCESS: |
| if (value == null) { |
| unsetSuccess(); |
| } else { |
| setSuccess((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case SUCCESS: |
| return getSuccess(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case SUCCESS: |
| return isSetSuccess(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof customException_result) |
| return this.equals((customException_result)that); |
| return false; |
| } |
| |
| public boolean equals(customException_result that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_success = true && this.isSetSuccess(); |
| boolean that_present_success = true && that.isSetSuccess(); |
| if (this_present_success || that_present_success) { |
| if (!(this_present_success && that_present_success)) |
| return false; |
| if (!this.success.equals(that.success)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); |
| if (isSetSuccess()) |
| hashCode = hashCode * 8191 + success.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(customException_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetSuccess()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("customException_result("); |
| boolean first = true; |
| |
| sb.append("success:"); |
| if (this.success == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.success); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class customException_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public customException_resultStandardScheme getScheme() { |
| return new customException_resultStandardScheme(); |
| } |
| } |
| |
| private static class customException_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<customException_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, customException_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 0: // SUCCESS |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, customException_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.success != null) { |
| oprot.writeFieldBegin(SUCCESS_FIELD_DESC); |
| oprot.writeString(struct.success); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class customException_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public customException_resultTupleScheme getScheme() { |
| return new customException_resultTupleScheme(); |
| } |
| } |
| |
| private static class customException_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<customException_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, customException_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetSuccess()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetSuccess()) { |
| oprot.writeString(struct.success); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, customException_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet incoming = iprot.readBitSet(1); |
| if (incoming.get(0)) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class context_args implements org.apache.thrift.TBase<context_args, context_args._Fields>, java.io.Serializable, Cloneable, Comparable<context_args> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("context_args"); |
| |
| private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new context_argsStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new context_argsTupleSchemeFactory(); |
| |
| public String name; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| NAME((short)1, "name"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.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: // NAME |
| return NAME; |
| 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 java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(context_args.class, metaDataMap); |
| } |
| |
| public context_args() { |
| } |
| |
| public context_args( |
| String name) |
| { |
| this(); |
| this.name = name; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public context_args(context_args other) { |
| if (other.isSetName()) { |
| this.name = other.name; |
| } |
| } |
| |
| public context_args deepCopy() { |
| return new context_args(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.name = null; |
| } |
| |
| public String getName() { |
| return this.name; |
| } |
| |
| public context_args setName(String name) { |
| this.name = name; |
| return this; |
| } |
| |
| public void unsetName() { |
| this.name = null; |
| } |
| |
| /** Returns true if field name is set (has been assigned a value) and false otherwise */ |
| public boolean isSetName() { |
| return this.name != null; |
| } |
| |
| public void setNameIsSet(boolean value) { |
| if (!value) { |
| this.name = null; |
| } |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case NAME: |
| if (value == null) { |
| unsetName(); |
| } else { |
| setName((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case NAME: |
| return getName(); |
| |
| } |
| 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 NAME: |
| return isSetName(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof context_args) |
| return this.equals((context_args)that); |
| return false; |
| } |
| |
| public boolean equals(context_args that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_name = true && this.isSetName(); |
| boolean that_present_name = true && that.isSetName(); |
| if (this_present_name || that_present_name) { |
| if (!(this_present_name && that_present_name)) |
| return false; |
| if (!this.name.equals(that.name)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287); |
| if (isSetName()) |
| hashCode = hashCode * 8191 + name.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(context_args other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetName()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("context_args("); |
| boolean first = true; |
| |
| sb.append("name:"); |
| if (this.name == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.name); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (name == null) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); |
| } |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class context_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public context_argsStandardScheme getScheme() { |
| return new context_argsStandardScheme(); |
| } |
| } |
| |
| private static class context_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<context_args> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, context_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // NAME |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, context_args struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.name != null) { |
| oprot.writeFieldBegin(NAME_FIELD_DESC); |
| oprot.writeString(struct.name); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class context_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public context_argsTupleScheme getScheme() { |
| return new context_argsTupleScheme(); |
| } |
| } |
| |
| private static class context_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<context_args> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, context_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| oprot.writeString(struct.name); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, context_args struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| struct.name = iprot.readString(); |
| struct.setNameIsSet(true); |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| public static class context_result implements org.apache.thrift.TBase<context_result, context_result._Fields>, java.io.Serializable, Cloneable, Comparable<context_result> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("context_result"); |
| |
| private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); |
| |
| private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new context_resultStandardSchemeFactory(); |
| private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new context_resultTupleSchemeFactory(); |
| |
| public String success; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| SUCCESS((short)0, "success"); |
| |
| private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 0: // SUCCESS |
| return SUCCESS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(context_result.class, metaDataMap); |
| } |
| |
| public context_result() { |
| } |
| |
| public context_result( |
| String success) |
| { |
| this(); |
| this.success = success; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public context_result(context_result other) { |
| if (other.isSetSuccess()) { |
| this.success = other.success; |
| } |
| } |
| |
| public context_result deepCopy() { |
| return new context_result(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.success = null; |
| } |
| |
| public String getSuccess() { |
| return this.success; |
| } |
| |
| public context_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 void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case SUCCESS: |
| if (value == null) { |
| unsetSuccess(); |
| } else { |
| setSuccess((String)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case SUCCESS: |
| return getSuccess(); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case SUCCESS: |
| return isSetSuccess(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof context_result) |
| return this.equals((context_result)that); |
| return false; |
| } |
| |
| public boolean equals(context_result that) { |
| if (that == null) |
| return false; |
| if (this == that) |
| return true; |
| |
| boolean this_present_success = true && this.isSetSuccess(); |
| boolean that_present_success = true && that.isSetSuccess(); |
| if (this_present_success || that_present_success) { |
| if (!(this_present_success && that_present_success)) |
| return false; |
| if (!this.success.equals(that.success)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| int hashCode = 1; |
| |
| hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); |
| if (isSetSuccess()) |
| hashCode = hashCode * 8191 + success.hashCode(); |
| |
| return hashCode; |
| } |
| |
| @Override |
| public int compareTo(context_result other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetSuccess()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { |
| scheme(iprot).read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { |
| scheme(oprot).write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("context_result("); |
| boolean first = true; |
| |
| sb.append("success:"); |
| if (this.success == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.success); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (org.apache.thrift.TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class context_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public context_resultStandardScheme getScheme() { |
| return new context_resultStandardScheme(); |
| } |
| } |
| |
| private static class context_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<context_result> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, context_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 0: // SUCCESS |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| |
| // check for required fields of primitive type, which can't be checked in the validate method |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, context_result struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.success != null) { |
| oprot.writeFieldBegin(SUCCESS_FIELD_DESC); |
| oprot.writeString(struct.success); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class context_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { |
| public context_resultTupleScheme getScheme() { |
| return new context_resultTupleScheme(); |
| } |
| } |
| |
| private static class context_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<context_result> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, context_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet optionals = new java.util.BitSet(); |
| if (struct.isSetSuccess()) { |
| optionals.set(0); |
| } |
| oprot.writeBitSet(optionals, 1); |
| if (struct.isSetSuccess()) { |
| oprot.writeString(struct.success); |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, context_result struct) throws org.apache.thrift.TException { |
| org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; |
| java.util.BitSet incoming = iprot.readBitSet(1); |
| if (incoming.get(0)) { |
| struct.success = iprot.readString(); |
| struct.setSuccessIsSet(true); |
| } |
| } |
| } |
| |
| private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { |
| return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); |
| } |
| } |
| |
| } |