/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.justdebugit.thrift.generated; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-7-13") public class UserManagerService { public interface Iface extends com.justdebugit.thrift.generated.UserRepoService.Iface { /** * 获取我的好友列表 * * @param uid */ public Set<com.justdebugit.thrift.generated.UserInfo> getMyFriends(int uid) throws org.apache.thrift.TException; public void defriend(int uid1, int uid2) throws org.apache.thrift.TException; public boolean addfriend(int uid1, int uid2) throws org.apache.thrift.TException; public int compare(int uid1, int uid2) throws DifferentSourceDetectedException, org.apache.thrift.TException; } public interface AsyncIface extends com.justdebugit.thrift.generated.UserRepoService .AsyncIface { public void getMyFriends(int uid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void defriend(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void addfriend(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void compare(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } public static class Client extends com.justdebugit.thrift.generated.UserRepoService.Client 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 Set<com.justdebugit.thrift.generated.UserInfo> getMyFriends(int uid) throws org.apache.thrift.TException { send_getMyFriends(uid); return recv_getMyFriends(); } public void send_getMyFriends(int uid) throws org.apache.thrift.TException { getMyFriends_args args = new getMyFriends_args(); args.setUid(uid); sendBase("getMyFriends", args); } public Set<com.justdebugit.thrift.generated.UserInfo> recv_getMyFriends() throws org.apache.thrift.TException { getMyFriends_result result = new getMyFriends_result(); receiveBase(result, "getMyFriends"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMyFriends failed: unknown result"); } public void defriend(int uid1, int uid2) throws org.apache.thrift.TException { send_defriend(uid1, uid2); } public void send_defriend(int uid1, int uid2) throws org.apache.thrift.TException { defriend_args args = new defriend_args(); args.setUid1(uid1); args.setUid2(uid2); sendBase("defriend", args); } public boolean addfriend(int uid1, int uid2) throws org.apache.thrift.TException { send_addfriend(uid1, uid2); return recv_addfriend(); } public void send_addfriend(int uid1, int uid2) throws org.apache.thrift.TException { addfriend_args args = new addfriend_args(); args.setUid1(uid1); args.setUid2(uid2); sendBase("addfriend", args); } public boolean recv_addfriend() throws org.apache.thrift.TException { addfriend_result result = new addfriend_result(); receiveBase(result, "addfriend"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addfriend failed: unknown result"); } public int compare(int uid1, int uid2) throws DifferentSourceDetectedException, org.apache.thrift.TException { send_compare(uid1, uid2); return recv_compare(); } public void send_compare(int uid1, int uid2) throws org.apache.thrift.TException { compare_args args = new compare_args(); args.setUid1(uid1); args.setUid2(uid2); sendBase("compare", args); } public int recv_compare() throws DifferentSourceDetectedException, org.apache.thrift.TException { compare_result result = new compare_result(); receiveBase(result, "compare"); if (result.isSetSuccess()) { return result.success; } if (result.dsde != null) { throw result.dsde; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "compare failed: unknown result"); } } public static class AsyncClient extends com.justdebugit.thrift.generated.UserRepoService.AsyncClient 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 getMyFriends(int uid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getMyFriends_call method_call = new getMyFriends_call(uid, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getMyFriends_call extends org.apache.thrift.async.TAsyncMethodCall { private int uid; public getMyFriends_call(int uid, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.uid = uid; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMyFriends", org.apache.thrift.protocol.TMessageType.CALL, 0)); getMyFriends_args args = new getMyFriends_args(); args.setUid(uid); args.write(prot); prot.writeMessageEnd(); } public Set<com.justdebugit.thrift.generated.UserInfo> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getMyFriends(); } } public void defriend(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); defriend_call method_call = new defriend_call(uid1, uid2, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class defriend_call extends org.apache.thrift.async.TAsyncMethodCall { private int uid1; private int uid2; public defriend_call(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, true); this.uid1 = uid1; this.uid2 = uid2; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("defriend", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); defriend_args args = new defriend_args(); args.setUid1(uid1); args.setUid2(uid2); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); } } public void addfriend(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); addfriend_call method_call = new addfriend_call(uid1, uid2, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addfriend_call extends org.apache.thrift.async.TAsyncMethodCall { private int uid1; private int uid2; public addfriend_call(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.uid1 = uid1; this.uid2 = uid2; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addfriend", org.apache.thrift.protocol.TMessageType.CALL, 0)); addfriend_args args = new addfriend_args(); args.setUid1(uid1); args.setUid2(uid2); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_addfriend(); } } public void compare(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); compare_call method_call = new compare_call(uid1, uid2, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class compare_call extends org.apache.thrift.async.TAsyncMethodCall { private int uid1; private int uid2; public compare_call(int uid1, int uid2, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.uid1 = uid1; this.uid2 = uid2; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("compare", org.apache.thrift.protocol.TMessageType.CALL, 0)); compare_args args = new compare_args(); args.setUid1(uid1); args.setUid2(uid2); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws DifferentSourceDetectedException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_compare(); } } } public static class Processor<I extends Iface> extends com.justdebugit.thrift.generated.UserRepoService.Processor<I> implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("getMyFriends", new getMyFriends()); processMap.put("defriend", new defriend()); processMap.put("addfriend", new addfriend()); processMap.put("compare", new compare()); return processMap; } public static class getMyFriends<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getMyFriends_args> { public getMyFriends() { super("getMyFriends"); } public getMyFriends_args getEmptyArgsInstance() { return new getMyFriends_args(); } protected boolean isOneway() { return false; } public getMyFriends_result getResult(I iface, getMyFriends_args args) throws org.apache.thrift.TException { getMyFriends_result result = new getMyFriends_result(); result.success = iface.getMyFriends(args.uid); return result; } } public static class defriend<I extends Iface> extends org.apache.thrift.ProcessFunction<I, defriend_args> { public defriend() { super("defriend"); } public defriend_args getEmptyArgsInstance() { return new defriend_args(); } protected boolean isOneway() { return true; } public org.apache.thrift.TBase getResult(I iface, defriend_args args) throws org.apache.thrift.TException { iface.defriend(args.uid1, args.uid2); return null; } } public static class addfriend<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addfriend_args> { public addfriend() { super("addfriend"); } public addfriend_args getEmptyArgsInstance() { return new addfriend_args(); } protected boolean isOneway() { return false; } public addfriend_result getResult(I iface, addfriend_args args) throws org.apache.thrift.TException { addfriend_result result = new addfriend_result(); result.success = iface.addfriend(args.uid1, args.uid2); result.setSuccessIsSet(true); return result; } } public static class compare<I extends Iface> extends org.apache.thrift.ProcessFunction<I, compare_args> { public compare() { super("compare"); } public compare_args getEmptyArgsInstance() { return new compare_args(); } protected boolean isOneway() { return false; } public compare_result getResult(I iface, compare_args args) throws org.apache.thrift.TException { compare_result result = new compare_result(); try { result.success = iface.compare(args.uid1, args.uid2); result.setSuccessIsSet(true); } catch (DifferentSourceDetectedException dsde) { result.dsde = dsde; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends com.justdebugit.thrift.generated.UserRepoService.AsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("getMyFriends", new getMyFriends()); processMap.put("defriend", new defriend()); processMap.put("addfriend", new addfriend()); processMap.put("compare", new compare()); return processMap; } public static class getMyFriends<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getMyFriends_args, Set<com.justdebugit.thrift.generated.UserInfo>> { public getMyFriends() { super("getMyFriends"); } public getMyFriends_args getEmptyArgsInstance() { return new getMyFriends_args(); } public AsyncMethodCallback<Set<com.justdebugit.thrift.generated.UserInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Set<com.justdebugit.thrift.generated.UserInfo>>() { public void onComplete(Set<com.justdebugit.thrift.generated.UserInfo> o) { getMyFriends_result result = new getMyFriends_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getMyFriends_result result = new getMyFriends_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getMyFriends_args args, org.apache.thrift.async.AsyncMethodCallback<Set<com.justdebugit.thrift.generated.UserInfo>> resultHandler) throws TException { iface.getMyFriends(args.uid,resultHandler); } } public static class defriend<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, defriend_args, Void> { public defriend() { super("defriend"); } public defriend_args getEmptyArgsInstance() { return new defriend_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { } public void onError(Exception e) { } }; } protected boolean isOneway() { return true; } public void start(I iface, defriend_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.defriend(args.uid1, args.uid2,resultHandler); } } public static class addfriend<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addfriend_args, Boolean> { public addfriend() { super("addfriend"); } public addfriend_args getEmptyArgsInstance() { return new addfriend_args(); } public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Boolean>() { public void onComplete(Boolean o) { addfriend_result result = new addfriend_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; addfriend_result result = new addfriend_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, addfriend_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { iface.addfriend(args.uid1, args.uid2,resultHandler); } } public static class compare<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, compare_args, Integer> { public compare() { super("compare"); } public compare_args getEmptyArgsInstance() { return new compare_args(); } public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Integer>() { public void onComplete(Integer o) { compare_result result = new compare_result(); result.success = o; result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; compare_result result = new compare_result(); if (e instanceof DifferentSourceDetectedException) { result.dsde = (DifferentSourceDetectedException) e; result.setDsdeIsSet(true); msg = result; } else { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, compare_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException { iface.compare(args.uid1, args.uid2,resultHandler); } } } public static class getMyFriends_args implements org.apache.thrift.TBase<getMyFriends_args, getMyFriends_args._Fields>, java.io.Serializable, Cloneable, Comparable<getMyFriends_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMyFriends_args"); private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField("uid", org.apache.thrift.protocol.TType.I32, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getMyFriends_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getMyFriends_argsTupleSchemeFactory()); } public int uid; // 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 { UID((short)1, "uid"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UID return UID; 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 __UID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMyFriends_args.class, metaDataMap); } public getMyFriends_args() { } public getMyFriends_args( int uid) { this(); this.uid = uid; setUidIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public getMyFriends_args(getMyFriends_args other) { __isset_bitfield = other.__isset_bitfield; this.uid = other.uid; } public getMyFriends_args deepCopy() { return new getMyFriends_args(this); } @Override public void clear() { setUidIsSet(false); this.uid = 0; } public int getUid() { return this.uid; } public getMyFriends_args setUid(int uid) { this.uid = uid; setUidIsSet(true); return this; } public void unsetUid() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID); } /** Returns true if field uid is set (has been assigned a value) and false otherwise */ public boolean isSetUid() { return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID); } public void setUidIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case UID: if (value == null) { unsetUid(); } else { setUid((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case UID: return Integer.valueOf(getUid()); } 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 UID: return isSetUid(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getMyFriends_args) return this.equals((getMyFriends_args)that); return false; } public boolean equals(getMyFriends_args that) { if (that == null) return false; boolean this_present_uid = true; boolean that_present_uid = true; if (this_present_uid || that_present_uid) { if (!(this_present_uid && that_present_uid)) return false; if (this.uid != that.uid) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_uid = true; list.add(present_uid); if (present_uid) list.add(uid); return list.hashCode(); } @Override public int compareTo(getMyFriends_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid()); if (lastComparison != 0) { return lastComparison; } if (isSetUid()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getMyFriends_args("); boolean first = true; sb.append("uid:"); sb.append(this.uid); 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 getMyFriends_argsStandardSchemeFactory implements SchemeFactory { public getMyFriends_argsStandardScheme getScheme() { return new getMyFriends_argsStandardScheme(); } } private static class getMyFriends_argsStandardScheme extends StandardScheme<getMyFriends_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getMyFriends_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: // UID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid = iprot.readI32(); struct.setUidIsSet(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, getMyFriends_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(UID_FIELD_DESC); oprot.writeI32(struct.uid); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getMyFriends_argsTupleSchemeFactory implements SchemeFactory { public getMyFriends_argsTupleScheme getScheme() { return new getMyFriends_argsTupleScheme(); } } private static class getMyFriends_argsTupleScheme extends TupleScheme<getMyFriends_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getMyFriends_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUid()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetUid()) { oprot.writeI32(struct.uid); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getMyFriends_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.uid = iprot.readI32(); struct.setUidIsSet(true); } } } } public static class getMyFriends_result implements org.apache.thrift.TBase<getMyFriends_result, getMyFriends_result._Fields>, java.io.Serializable, Cloneable, Comparable<getMyFriends_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMyFriends_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.SET, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getMyFriends_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getMyFriends_resultTupleSchemeFactory()); } public Set<com.justdebugit.thrift.generated.UserInfo> 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 Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.justdebugit.thrift.generated.UserInfo.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMyFriends_result.class, metaDataMap); } public getMyFriends_result() { } public getMyFriends_result( Set<com.justdebugit.thrift.generated.UserInfo> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getMyFriends_result(getMyFriends_result other) { if (other.isSetSuccess()) { Set<com.justdebugit.thrift.generated.UserInfo> __this__success = new HashSet<com.justdebugit.thrift.generated.UserInfo>(other.success.size()); for (com.justdebugit.thrift.generated.UserInfo other_element : other.success) { __this__success.add(new com.justdebugit.thrift.generated.UserInfo(other_element)); } this.success = __this__success; } } public getMyFriends_result deepCopy() { return new getMyFriends_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<com.justdebugit.thrift.generated.UserInfo> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(com.justdebugit.thrift.generated.UserInfo elem) { if (this.success == null) { this.success = new HashSet<com.justdebugit.thrift.generated.UserInfo>(); } this.success.add(elem); } public Set<com.justdebugit.thrift.generated.UserInfo> getSuccess() { return this.success; } public getMyFriends_result setSuccess(Set<com.justdebugit.thrift.generated.UserInfo> 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((Set<com.justdebugit.thrift.generated.UserInfo>)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 getMyFriends_result) return this.equals((getMyFriends_result)that); return false; } public boolean equals(getMyFriends_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(getMyFriends_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 { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getMyFriends_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 getMyFriends_resultStandardSchemeFactory implements SchemeFactory { public getMyFriends_resultStandardScheme getScheme() { return new getMyFriends_resultStandardScheme(); } } private static class getMyFriends_resultStandardScheme extends StandardScheme<getMyFriends_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getMyFriends_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.SET) { { org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin(); struct.success = new HashSet<com.justdebugit.thrift.generated.UserInfo>(2*_set0.size); com.justdebugit.thrift.generated.UserInfo _elem1; for (int _i2 = 0; _i2 < _set0.size; ++_i2) { _elem1 = new com.justdebugit.thrift.generated.UserInfo(); _elem1.read(iprot); struct.success.add(_elem1); } iprot.readSetEnd(); } 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, getMyFriends_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (com.justdebugit.thrift.generated.UserInfo _iter3 : struct.success) { _iter3.write(oprot); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getMyFriends_resultTupleSchemeFactory implements SchemeFactory { public getMyFriends_resultTupleScheme getScheme() { return new getMyFriends_resultTupleScheme(); } } private static class getMyFriends_resultTupleScheme extends TupleScheme<getMyFriends_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getMyFriends_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (com.justdebugit.thrift.generated.UserInfo _iter4 : struct.success) { _iter4.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getMyFriends_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set5 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new HashSet<com.justdebugit.thrift.generated.UserInfo>(2*_set5.size); com.justdebugit.thrift.generated.UserInfo _elem6; for (int _i7 = 0; _i7 < _set5.size; ++_i7) { _elem6 = new com.justdebugit.thrift.generated.UserInfo(); _elem6.read(iprot); struct.success.add(_elem6); } } struct.setSuccessIsSet(true); } } } } public static class defriend_args implements org.apache.thrift.TBase<defriend_args, defriend_args._Fields>, java.io.Serializable, Cloneable, Comparable<defriend_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("defriend_args"); private static final org.apache.thrift.protocol.TField UID1_FIELD_DESC = new org.apache.thrift.protocol.TField("uid1", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField UID2_FIELD_DESC = new org.apache.thrift.protocol.TField("uid2", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new defriend_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new defriend_argsTupleSchemeFactory()); } public int uid1; // required public int uid2; // 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 { UID1((short)1, "uid1"), UID2((short)2, "uid2"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UID1 return UID1; case 2: // UID2 return UID2; 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 __UID1_ISSET_ID = 0; private static final int __UID2_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UID1, new org.apache.thrift.meta_data.FieldMetaData("uid1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.UID2, new org.apache.thrift.meta_data.FieldMetaData("uid2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(defriend_args.class, metaDataMap); } public defriend_args() { } public defriend_args( int uid1, int uid2) { this(); this.uid1 = uid1; setUid1IsSet(true); this.uid2 = uid2; setUid2IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public defriend_args(defriend_args other) { __isset_bitfield = other.__isset_bitfield; this.uid1 = other.uid1; this.uid2 = other.uid2; } public defriend_args deepCopy() { return new defriend_args(this); } @Override public void clear() { setUid1IsSet(false); this.uid1 = 0; setUid2IsSet(false); this.uid2 = 0; } public int getUid1() { return this.uid1; } public defriend_args setUid1(int uid1) { this.uid1 = uid1; setUid1IsSet(true); return this; } public void unsetUid1() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID1_ISSET_ID); } /** Returns true if field uid1 is set (has been assigned a value) and false otherwise */ public boolean isSetUid1() { return EncodingUtils.testBit(__isset_bitfield, __UID1_ISSET_ID); } public void setUid1IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID1_ISSET_ID, value); } public int getUid2() { return this.uid2; } public defriend_args setUid2(int uid2) { this.uid2 = uid2; setUid2IsSet(true); return this; } public void unsetUid2() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID2_ISSET_ID); } /** Returns true if field uid2 is set (has been assigned a value) and false otherwise */ public boolean isSetUid2() { return EncodingUtils.testBit(__isset_bitfield, __UID2_ISSET_ID); } public void setUid2IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID2_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case UID1: if (value == null) { unsetUid1(); } else { setUid1((Integer)value); } break; case UID2: if (value == null) { unsetUid2(); } else { setUid2((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case UID1: return Integer.valueOf(getUid1()); case UID2: return Integer.valueOf(getUid2()); } 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 UID1: return isSetUid1(); case UID2: return isSetUid2(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof defriend_args) return this.equals((defriend_args)that); return false; } public boolean equals(defriend_args that) { if (that == null) return false; boolean this_present_uid1 = true; boolean that_present_uid1 = true; if (this_present_uid1 || that_present_uid1) { if (!(this_present_uid1 && that_present_uid1)) return false; if (this.uid1 != that.uid1) return false; } boolean this_present_uid2 = true; boolean that_present_uid2 = true; if (this_present_uid2 || that_present_uid2) { if (!(this_present_uid2 && that_present_uid2)) return false; if (this.uid2 != that.uid2) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_uid1 = true; list.add(present_uid1); if (present_uid1) list.add(uid1); boolean present_uid2 = true; list.add(present_uid2); if (present_uid2) list.add(uid2); return list.hashCode(); } @Override public int compareTo(defriend_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetUid1()).compareTo(other.isSetUid1()); if (lastComparison != 0) { return lastComparison; } if (isSetUid1()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid1, other.uid1); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUid2()).compareTo(other.isSetUid2()); if (lastComparison != 0) { return lastComparison; } if (isSetUid2()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid2, other.uid2); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("defriend_args("); boolean first = true; sb.append("uid1:"); sb.append(this.uid1); first = false; if (!first) sb.append(", "); sb.append("uid2:"); sb.append(this.uid2); 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 defriend_argsStandardSchemeFactory implements SchemeFactory { public defriend_argsStandardScheme getScheme() { return new defriend_argsStandardScheme(); } } private static class defriend_argsStandardScheme extends StandardScheme<defriend_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, defriend_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: // UID1 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UID2 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(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, defriend_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(UID1_FIELD_DESC); oprot.writeI32(struct.uid1); oprot.writeFieldEnd(); oprot.writeFieldBegin(UID2_FIELD_DESC); oprot.writeI32(struct.uid2); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class defriend_argsTupleSchemeFactory implements SchemeFactory { public defriend_argsTupleScheme getScheme() { return new defriend_argsTupleScheme(); } } private static class defriend_argsTupleScheme extends TupleScheme<defriend_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, defriend_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUid1()) { optionals.set(0); } if (struct.isSetUid2()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUid1()) { oprot.writeI32(struct.uid1); } if (struct.isSetUid2()) { oprot.writeI32(struct.uid2); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, defriend_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } if (incoming.get(1)) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(true); } } } } public static class addfriend_args implements org.apache.thrift.TBase<addfriend_args, addfriend_args._Fields>, java.io.Serializable, Cloneable, Comparable<addfriend_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addfriend_args"); private static final org.apache.thrift.protocol.TField UID1_FIELD_DESC = new org.apache.thrift.protocol.TField("uid1", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField UID2_FIELD_DESC = new org.apache.thrift.protocol.TField("uid2", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addfriend_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new addfriend_argsTupleSchemeFactory()); } public int uid1; // required public int uid2; // 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 { UID1((short)1, "uid1"), UID2((short)2, "uid2"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UID1 return UID1; case 2: // UID2 return UID2; 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 __UID1_ISSET_ID = 0; private static final int __UID2_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UID1, new org.apache.thrift.meta_data.FieldMetaData("uid1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.UID2, new org.apache.thrift.meta_data.FieldMetaData("uid2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addfriend_args.class, metaDataMap); } public addfriend_args() { } public addfriend_args( int uid1, int uid2) { this(); this.uid1 = uid1; setUid1IsSet(true); this.uid2 = uid2; setUid2IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public addfriend_args(addfriend_args other) { __isset_bitfield = other.__isset_bitfield; this.uid1 = other.uid1; this.uid2 = other.uid2; } public addfriend_args deepCopy() { return new addfriend_args(this); } @Override public void clear() { setUid1IsSet(false); this.uid1 = 0; setUid2IsSet(false); this.uid2 = 0; } public int getUid1() { return this.uid1; } public addfriend_args setUid1(int uid1) { this.uid1 = uid1; setUid1IsSet(true); return this; } public void unsetUid1() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID1_ISSET_ID); } /** Returns true if field uid1 is set (has been assigned a value) and false otherwise */ public boolean isSetUid1() { return EncodingUtils.testBit(__isset_bitfield, __UID1_ISSET_ID); } public void setUid1IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID1_ISSET_ID, value); } public int getUid2() { return this.uid2; } public addfriend_args setUid2(int uid2) { this.uid2 = uid2; setUid2IsSet(true); return this; } public void unsetUid2() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID2_ISSET_ID); } /** Returns true if field uid2 is set (has been assigned a value) and false otherwise */ public boolean isSetUid2() { return EncodingUtils.testBit(__isset_bitfield, __UID2_ISSET_ID); } public void setUid2IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID2_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case UID1: if (value == null) { unsetUid1(); } else { setUid1((Integer)value); } break; case UID2: if (value == null) { unsetUid2(); } else { setUid2((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case UID1: return Integer.valueOf(getUid1()); case UID2: return Integer.valueOf(getUid2()); } 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 UID1: return isSetUid1(); case UID2: return isSetUid2(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addfriend_args) return this.equals((addfriend_args)that); return false; } public boolean equals(addfriend_args that) { if (that == null) return false; boolean this_present_uid1 = true; boolean that_present_uid1 = true; if (this_present_uid1 || that_present_uid1) { if (!(this_present_uid1 && that_present_uid1)) return false; if (this.uid1 != that.uid1) return false; } boolean this_present_uid2 = true; boolean that_present_uid2 = true; if (this_present_uid2 || that_present_uid2) { if (!(this_present_uid2 && that_present_uid2)) return false; if (this.uid2 != that.uid2) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_uid1 = true; list.add(present_uid1); if (present_uid1) list.add(uid1); boolean present_uid2 = true; list.add(present_uid2); if (present_uid2) list.add(uid2); return list.hashCode(); } @Override public int compareTo(addfriend_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetUid1()).compareTo(other.isSetUid1()); if (lastComparison != 0) { return lastComparison; } if (isSetUid1()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid1, other.uid1); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUid2()).compareTo(other.isSetUid2()); if (lastComparison != 0) { return lastComparison; } if (isSetUid2()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid2, other.uid2); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addfriend_args("); boolean first = true; sb.append("uid1:"); sb.append(this.uid1); first = false; if (!first) sb.append(", "); sb.append("uid2:"); sb.append(this.uid2); 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 addfriend_argsStandardSchemeFactory implements SchemeFactory { public addfriend_argsStandardScheme getScheme() { return new addfriend_argsStandardScheme(); } } private static class addfriend_argsStandardScheme extends StandardScheme<addfriend_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, addfriend_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: // UID1 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UID2 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(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, addfriend_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(UID1_FIELD_DESC); oprot.writeI32(struct.uid1); oprot.writeFieldEnd(); oprot.writeFieldBegin(UID2_FIELD_DESC); oprot.writeI32(struct.uid2); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addfriend_argsTupleSchemeFactory implements SchemeFactory { public addfriend_argsTupleScheme getScheme() { return new addfriend_argsTupleScheme(); } } private static class addfriend_argsTupleScheme extends TupleScheme<addfriend_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addfriend_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUid1()) { optionals.set(0); } if (struct.isSetUid2()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUid1()) { oprot.writeI32(struct.uid1); } if (struct.isSetUid2()) { oprot.writeI32(struct.uid2); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, addfriend_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } if (incoming.get(1)) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(true); } } } } public static class addfriend_result implements org.apache.thrift.TBase<addfriend_result, addfriend_result._Fields>, java.io.Serializable, Cloneable, Comparable<addfriend_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addfriend_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addfriend_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new addfriend_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 Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addfriend_result.class, metaDataMap); } public addfriend_result() { } public addfriend_result( boolean success) { this(); this.success = success; setSuccessIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public addfriend_result(addfriend_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; } public addfriend_result deepCopy() { return new addfriend_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; } public boolean isSuccess() { return this.success; } public addfriend_result setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public 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 Boolean.valueOf(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 addfriend_result) return this.equals((addfriend_result)that); return false; } public boolean equals(addfriend_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true; list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(addfriend_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 { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addfriend_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 addfriend_resultStandardSchemeFactory implements SchemeFactory { public addfriend_resultStandardScheme getScheme() { return new addfriend_resultStandardScheme(); } } private static class addfriend_resultStandardScheme extends StandardScheme<addfriend_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, addfriend_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, addfriend_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 addfriend_resultTupleSchemeFactory implements SchemeFactory { public addfriend_resultTupleScheme getScheme() { return new addfriend_resultTupleScheme(); } } private static class addfriend_resultTupleScheme extends TupleScheme<addfriend_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, addfriend_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new 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, addfriend_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } } } } public static class compare_args implements org.apache.thrift.TBase<compare_args, compare_args._Fields>, java.io.Serializable, Cloneable, Comparable<compare_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("compare_args"); private static final org.apache.thrift.protocol.TField UID1_FIELD_DESC = new org.apache.thrift.protocol.TField("uid1", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField UID2_FIELD_DESC = new org.apache.thrift.protocol.TField("uid2", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new compare_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new compare_argsTupleSchemeFactory()); } public int uid1; // required public int uid2; // 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 { UID1((short)1, "uid1"), UID2((short)2, "uid2"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // UID1 return UID1; case 2: // UID2 return UID2; 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 __UID1_ISSET_ID = 0; private static final int __UID2_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UID1, new org.apache.thrift.meta_data.FieldMetaData("uid1", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.UID2, new org.apache.thrift.meta_data.FieldMetaData("uid2", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(compare_args.class, metaDataMap); } public compare_args() { } public compare_args( int uid1, int uid2) { this(); this.uid1 = uid1; setUid1IsSet(true); this.uid2 = uid2; setUid2IsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public compare_args(compare_args other) { __isset_bitfield = other.__isset_bitfield; this.uid1 = other.uid1; this.uid2 = other.uid2; } public compare_args deepCopy() { return new compare_args(this); } @Override public void clear() { setUid1IsSet(false); this.uid1 = 0; setUid2IsSet(false); this.uid2 = 0; } public int getUid1() { return this.uid1; } public compare_args setUid1(int uid1) { this.uid1 = uid1; setUid1IsSet(true); return this; } public void unsetUid1() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID1_ISSET_ID); } /** Returns true if field uid1 is set (has been assigned a value) and false otherwise */ public boolean isSetUid1() { return EncodingUtils.testBit(__isset_bitfield, __UID1_ISSET_ID); } public void setUid1IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID1_ISSET_ID, value); } public int getUid2() { return this.uid2; } public compare_args setUid2(int uid2) { this.uid2 = uid2; setUid2IsSet(true); return this; } public void unsetUid2() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID2_ISSET_ID); } /** Returns true if field uid2 is set (has been assigned a value) and false otherwise */ public boolean isSetUid2() { return EncodingUtils.testBit(__isset_bitfield, __UID2_ISSET_ID); } public void setUid2IsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID2_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case UID1: if (value == null) { unsetUid1(); } else { setUid1((Integer)value); } break; case UID2: if (value == null) { unsetUid2(); } else { setUid2((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case UID1: return Integer.valueOf(getUid1()); case UID2: return Integer.valueOf(getUid2()); } 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 UID1: return isSetUid1(); case UID2: return isSetUid2(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof compare_args) return this.equals((compare_args)that); return false; } public boolean equals(compare_args that) { if (that == null) return false; boolean this_present_uid1 = true; boolean that_present_uid1 = true; if (this_present_uid1 || that_present_uid1) { if (!(this_present_uid1 && that_present_uid1)) return false; if (this.uid1 != that.uid1) return false; } boolean this_present_uid2 = true; boolean that_present_uid2 = true; if (this_present_uid2 || that_present_uid2) { if (!(this_present_uid2 && that_present_uid2)) return false; if (this.uid2 != that.uid2) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_uid1 = true; list.add(present_uid1); if (present_uid1) list.add(uid1); boolean present_uid2 = true; list.add(present_uid2); if (present_uid2) list.add(uid2); return list.hashCode(); } @Override public int compareTo(compare_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetUid1()).compareTo(other.isSetUid1()); if (lastComparison != 0) { return lastComparison; } if (isSetUid1()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid1, other.uid1); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUid2()).compareTo(other.isSetUid2()); if (lastComparison != 0) { return lastComparison; } if (isSetUid2()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid2, other.uid2); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("compare_args("); boolean first = true; sb.append("uid1:"); sb.append(this.uid1); first = false; if (!first) sb.append(", "); sb.append("uid2:"); sb.append(this.uid2); 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 compare_argsStandardSchemeFactory implements SchemeFactory { public compare_argsStandardScheme getScheme() { return new compare_argsStandardScheme(); } } private static class compare_argsStandardScheme extends StandardScheme<compare_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, compare_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: // UID1 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // UID2 if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(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, compare_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(UID1_FIELD_DESC); oprot.writeI32(struct.uid1); oprot.writeFieldEnd(); oprot.writeFieldBegin(UID2_FIELD_DESC); oprot.writeI32(struct.uid2); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class compare_argsTupleSchemeFactory implements SchemeFactory { public compare_argsTupleScheme getScheme() { return new compare_argsTupleScheme(); } } private static class compare_argsTupleScheme extends TupleScheme<compare_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, compare_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetUid1()) { optionals.set(0); } if (struct.isSetUid2()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUid1()) { oprot.writeI32(struct.uid1); } if (struct.isSetUid2()) { oprot.writeI32(struct.uid2); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, compare_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.uid1 = iprot.readI32(); struct.setUid1IsSet(true); } if (incoming.get(1)) { struct.uid2 = iprot.readI32(); struct.setUid2IsSet(true); } } } } public static class compare_result implements org.apache.thrift.TBase<compare_result, compare_result._Fields>, java.io.Serializable, Cloneable, Comparable<compare_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("compare_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField DSDE_FIELD_DESC = new org.apache.thrift.protocol.TField("dsde", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new compare_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new compare_resultTupleSchemeFactory()); } public int success; // required public DifferentSourceDetectedException dsde; // 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"), DSDE((short)1, "dsde"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // DSDE return DSDE; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DSDE, new org.apache.thrift.meta_data.FieldMetaData("dsde", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(compare_result.class, metaDataMap); } public compare_result() { } public compare_result( int success, DifferentSourceDetectedException dsde) { this(); this.success = success; setSuccessIsSet(true); this.dsde = dsde; } /** * Performs a deep copy on <i>other</i>. */ public compare_result(compare_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetDsde()) { this.dsde = new DifferentSourceDetectedException(other.dsde); } } public compare_result deepCopy() { return new compare_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = 0; this.dsde = null; } public int getSuccess() { return this.success; } public compare_result setSuccess(int success) { this.success = success; setSuccessIsSet(true); return this; } public void unsetSuccess() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public DifferentSourceDetectedException getDsde() { return this.dsde; } public compare_result setDsde(DifferentSourceDetectedException dsde) { this.dsde = dsde; return this; } public void unsetDsde() { this.dsde = null; } /** Returns true if field dsde is set (has been assigned a value) and false otherwise */ public boolean isSetDsde() { return this.dsde != null; } public void setDsdeIsSet(boolean value) { if (!value) { this.dsde = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Integer)value); } break; case DSDE: if (value == null) { unsetDsde(); } else { setDsde((DifferentSourceDetectedException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Integer.valueOf(getSuccess()); case DSDE: return getDsde(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case DSDE: return isSetDsde(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof compare_result) return this.equals((compare_result)that); return false; } public boolean equals(compare_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_dsde = true && this.isSetDsde(); boolean that_present_dsde = true && that.isSetDsde(); if (this_present_dsde || that_present_dsde) { if (!(this_present_dsde && that_present_dsde)) return false; if (!this.dsde.equals(that.dsde)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true; list.add(present_success); if (present_success) list.add(success); boolean present_dsde = true && (isSetDsde()); list.add(present_dsde); if (present_dsde) list.add(dsde); return list.hashCode(); } @Override public int compareTo(compare_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDsde()).compareTo(other.isSetDsde()); if (lastComparison != 0) { return lastComparison; } if (isSetDsde()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dsde, other.dsde); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("compare_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("dsde:"); if (this.dsde == null) { sb.append("null"); } else { sb.append(this.dsde); } 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 compare_resultStandardSchemeFactory implements SchemeFactory { public compare_resultStandardScheme getScheme() { return new compare_resultStandardScheme(); } } private static class compare_resultStandardScheme extends StandardScheme<compare_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, compare_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.I32) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // DSDE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.dsde = new DifferentSourceDetectedException(); struct.dsde.read(iprot); struct.setDsdeIsSet(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, compare_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(struct.success); oprot.writeFieldEnd(); } if (struct.dsde != null) { oprot.writeFieldBegin(DSDE_FIELD_DESC); struct.dsde.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class compare_resultTupleSchemeFactory implements SchemeFactory { public compare_resultTupleScheme getScheme() { return new compare_resultTupleScheme(); } } private static class compare_resultTupleScheme extends TupleScheme<compare_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, compare_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetDsde()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { oprot.writeI32(struct.success); } if (struct.isSetDsde()) { struct.dsde.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, compare_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = iprot.readI32(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.dsde = new DifferentSourceDetectedException(); struct.dsde.read(iprot); struct.setDsdeIsSet(true); } } } } }