View Javadoc

    1   /*
    2    *  Licensed to the Apache Software Foundation (ASF) under one
    3    *  or more contributor license agreements.  See the NOTICE file
    4    *  distributed with this work for additional information
    5    *  regarding copyright ownership.  The ASF licenses this file
    6    *  to you under the Apache License, Version 2.0 (the
    7    *  "License"); you may not use this file except in compliance
    8    *  with the License.  You may obtain a copy of the License at
    9    *
    10   *    http://www.apache.org/licenses/LICENSE-2.0
    11   *
    12   *  Unless required by applicable law or agreed to in writing,
    13   *  software distributed under the License is distributed on an
    14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    15   *  KIND, either express or implied.  See the License for the
    16   *  specific language governing permissions and limitations
    17   *  under the License.
    18   *
    19   */
    20
    21
    22  /**
    23   * Autogenerated by Thrift Compiler (0.9.0)
    24   *
    25   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
    26   *  @generated
    27   */
    28  package org.apache.mina.generated.thrift;
    29
    30  import java.util.BitSet;
    31  import java.util.Collections;
    32  import java.util.EnumMap;
    33  import java.util.EnumSet;
    34  import java.util.HashMap;
    35  import java.util.Map;
    36
    37  import org.apache.commons.lang.builder.HashCodeBuilder;
    38  import org.apache.thrift.EncodingUtils;
    39  import org.apache.thrift.protocol.TTupleProtocol;
    40  import org.apache.thrift.scheme.IScheme;
    41  import org.apache.thrift.scheme.SchemeFactory;
    42  import org.apache.thrift.scheme.StandardScheme;
    43  import org.apache.thrift.scheme.TupleScheme;
    44  import org.slf4j.Logger;
    45  import org.slf4j.LoggerFactory;
    46
    47  public class UserStorage {
    48
    49      public interface Iface {
    50
    51          public void store(UserProfile user) throws org.apache.thrift.TException;
    52
    53          public UserProfile retrieve(int uid) throws org.apache.thrift.TException;
    54
    55      }
    56
    57      public interface AsyncIface {
    58
    59          public void store(UserProfile user,
    60                  org.apache.thrift.async.AsyncMethodCallback<AsyncClient.store_call> resultHandler)
    61                  throws org.apache.thrift.TException;
    62
    63          public void retrieve(int uid,
    64                  org.apache.thrift.async.AsyncMethodCallback<AsyncClient.retrieve_call> resultHandler)
    65                  throws org.apache.thrift.TException;
    66
    67      }
    68
    69      public static class Client extends org.apache.thrift.TServiceClient implements Iface {
    70          public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
    71              public Factory() {
    72              }
    73
    74              public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
    75                  return new Client(prot);
    76              }
    77
    78              public Client getClient(org.apache.thrift.protocol.TProtocol iprot,
    79                      org.apache.thrift.protocol.TProtocol oprot) {
    80                  return new Client(iprot, oprot);
    81              }
    82          }
    83
    84          public Client(org.apache.thrift.protocol.TProtocol prot) {
    85              super(prot, prot);
    86          }
    87
    88          public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
    89              super(iprot, oprot);
    90          }
    91
    92          public void store(UserProfile user) throws org.apache.thrift.TException {
    93              send_store(user);
    94              recv_store();
    95          }
    96
    97          public void send_store(UserProfile user) throws org.apache.thrift.TException {
    98              store_args args = new store_args();
    99              args.setUser(user);
    100             sendBase("store", args);
    101         }
    102
    103         public void recv_store() throws org.apache.thrift.TException {
    104             store_result result = new store_result();
    105             receiveBase(result, "store");
    106             return;
    107         }
    108
    109         public UserProfile retrieve(int uid) throws org.apache.thrift.TException {
    110             send_retrieve(uid);
    111             return recv_retrieve();
    112         }
    113
    114         public void send_retrieve(int uid) throws org.apache.thrift.TException {
    115             retrieve_args args = new retrieve_args();
    116             args.setUid(uid);
    117             sendBase("retrieve", args);
    118         }
    119
    120         public UserProfile recv_retrieve() throws org.apache.thrift.TException {
    121             retrieve_result result = new retrieve_result();
    122             receiveBase(result, "retrieve");
    123             if (result.isSetSuccess()) {
    124                 return result.success;
    125             }
    126             throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT,
    127                     "retrieve failed: unknown result");
    128         }
    129
    130     }
    131
    132     public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
    133         public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
    134             private org.apache.thrift.async.TAsyncClientManager clientManager;
    135
    136             private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
    137
    138             public Factory(org.apache.thrift.async.TAsyncClientManager clientManager,
    139                     org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
    140                 this.clientManager = clientManager;
    141                 this.protocolFactory = protocolFactory;
    142             }
    143
    144             public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
    145                 return new AsyncClient(protocolFactory, clientManager, transport);
    146             }
    147         }
    148
    149         public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory,
    150                 org.apache.thrift.async.TAsyncClientManager clientManager,
    151                 org.apache.thrift.transport.TNonblockingTransport transport) {
    152             super(protocolFactory, clientManager, transport);
    153         }
    154
    155         public void store(UserProfile user, org.apache.thrift.async.AsyncMethodCallback<store_call> resultHandler)
    156                 throws org.apache.thrift.TException {
    157             checkReady();
    158             store_call method_call = new store_call(user, resultHandler, this, ___protocolFactory, ___transport);
    159             this.___currentMethod = method_call;
    160             ___manager.call(method_call);
    161         }
    162
    163         public static class store_call extends org.apache.thrift.async.TAsyncMethodCall {
    164             private UserProfile user;
    165
    166             public store_call(UserProfile user, org.apache.thrift.async.AsyncMethodCallback<store_call> resultHandler,
    167                     org.apache.thrift.async.TAsyncClient client,
    168                     org.apache.thrift.protocol.TProtocolFactory protocolFactory,
    169                     org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
    170                 super(client, protocolFactory, transport, resultHandler, false);
    171                 this.user = user;
    172             }
    173
    174             public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
    175                 prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("store",
    176                         org.apache.thrift.protocol.TMessageType.CALL, 0));
    177                 store_args args = new store_args();
    178                 args.setUser(user);
    179                 args.write(prot);
    180                 prot.writeMessageEnd();
    181             }
    182
    183             public void getResult() throws org.apache.thrift.TException {
    184                 if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
    185                     throw new IllegalStateException("Method call not finished!");
    186                 }
    187                 org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(
    188                         getFrameBuffer().array());
    189                 org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
    190                 (new Client(prot)).recv_store();
    191             }
    192         }
    193
    194         public void retrieve(int uid, org.apache.thrift.async.AsyncMethodCallback<retrieve_call> resultHandler)
    195                 throws org.apache.thrift.TException {
    196             checkReady();
    197             retrieve_call method_call = new retrieve_call(uid, resultHandler, this, ___protocolFactory, ___transport);
    198             this.___currentMethod = method_call;
    199             ___manager.call(method_call);
    200         }
    201
    202         public static class retrieve_call extends org.apache.thrift.async.TAsyncMethodCall {
    203             private int uid;
    204
    205             public retrieve_call(int uid, org.apache.thrift.async.AsyncMethodCallback<retrieve_call> resultHandler,
    206                     org.apache.thrift.async.TAsyncClient client,
    207                     org.apache.thrift.protocol.TProtocolFactory protocolFactory,
    208                     org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
    209                 super(client, protocolFactory, transport, resultHandler, false);
    210                 this.uid = uid;
    211             }
    212
    213             public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
    214                 prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("retrieve",
    215                         org.apache.thrift.protocol.TMessageType.CALL, 0));
    216                 retrieve_args args = new retrieve_args();
    217                 args.setUid(uid);
    218                 args.write(prot);
    219                 prot.writeMessageEnd();
    220             }
    221
    222             public UserProfile getResult() throws org.apache.thrift.TException {
    223                 if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
    224                     throw new IllegalStateException("Method call not finished!");
    225                 }
    226                 org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(
    227                         getFrameBuffer().array());
    228                 org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
    229                 return (new Client(prot)).recv_retrieve();
    230             }
    231         }
    232
    233     }
    234
    235     public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements
    236             org.apache.thrift.TProcessor {
    237         private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    238
    239         public Processor(I iface) {
    240             super(
    241                     iface,
    242                     getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    243         }
    244
    245         protected Processor(I iface,
    246                 Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
    247             super(iface, getProcessMap(processMap));
    248         }
    249
    250         private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(
    251                 Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
    252             processMap.put("store", new store());
    253             processMap.put("retrieve", new retrieve());
    254             return processMap;
    255         }
    256
    257         public static class store<I extends Iface> extends org.apache.thrift.ProcessFunction<I, store_args> {
    258             public store() {
    259                 super("store");
    260             }
    261
    262             public store_args getEmptyArgsInstance() {
    263                 return new store_args();
    264             }
    265
    266             protected boolean isOneway() {
    267                 return false;
    268             }
    269
    270             public store_result getResult(I iface, store_args args) throws org.apache.thrift.TException {
    271                 store_result result = new store_result();
    272                 iface.store(args.user);
    273                 return result;
    274             }
    275         }
    276
    277         public static class retrieve<I extends Iface> extends org.apache.thrift.ProcessFunction<I, retrieve_args> {
    278             public retrieve() {
    279                 super("retrieve");
    280             }
    281
    282             public retrieve_args getEmptyArgsInstance() {
    283                 return new retrieve_args();
    284             }
    285
    286             protected boolean isOneway() {
    287                 return false;
    288             }
    289
    290             public retrieve_result getResult(I iface, retrieve_args args) throws org.apache.thrift.TException {
    291                 retrieve_result result = new retrieve_result();
    292                 result.success = iface.retrieve(args.uid);
    293                 return result;
    294             }
    295         }
    296
    297     }
    298
    299     public static class store_args implements org.apache.thrift.TBase<store_args, store_args._Fields>,
    300             java.io.Serializable, Cloneable {
    301         private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct(
    302                 "store_args");
    303
    304         private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField(
    305                 "user", org.apache.thrift.protocol.TType.STRUCT, (short) 1);
    306
    307         private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    308         static {
    309             schemes.put(StandardScheme.class, new store_argsStandardSchemeFactory());
    310             schemes.put(TupleScheme.class, new store_argsTupleSchemeFactory());
    311         }
    312
    313         public UserProfile user; // required
    314
    315         /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    316         public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    317             USER((short) 1, "user");
    318
    319             private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
    320
    321             static {
    322                 for (_Fields field : EnumSet.allOf(_Fields.class)) {
    323                     byName.put(field.getFieldName(), field);
    324                 }
    325             }
    326
    327             /**
    328              * Find the _Fields constant that matches fieldId, or null if its not found.
    329              */
    330             public static _Fields findByThriftId(int fieldId) {
    331                 switch (fieldId) {
    332                 case 1: // USER
    333                     return USER;
    334                 default:
    335                     return null;
    336                 }
    337             }
    338
    339             /**
    340              * Find the _Fields constant that matches fieldId, throwing an exception
    341              * if it is not found.
    342              */
    343             public static _Fields findByThriftIdOrThrow(int fieldId) {
    344                 _Fields fields = findByThriftId(fieldId);
    345                 if (fields == null)
    346                     throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
    347                 return fields;
    348             }
    349
    350             /**
    351              * Find the _Fields constant that matches name, or null if its not found.
    352              */
    353             public static _Fields findByName(String name) {
    354                 return byName.get(name);
    355             }
    356
    357             private final short _thriftId;
    358
    359             private final String _fieldName;
    360
    361             _Fields(short thriftId, String fieldName) {
    362                 _thriftId = thriftId;
    363                 _fieldName = fieldName;
    364             }
    365
    366             public short getThriftFieldId() {
    367                 return _thriftId;
    368             }
    369
    370             public String getFieldName() {
    371                 return _fieldName;
    372             }
    373         }
    374
    375         // isset id assignments
    376         public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    377         static {
    378             Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
    379                     _Fields.class);
    380             tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user",
    381                     org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(
    382                             org.apache.thrift.protocol.TType.STRUCT, UserProfile.class)));
    383             metaDataMap = Collections.unmodifiableMap(tmpMap);
    384             org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(store_args.class, metaDataMap);
    385         }
    386
    387         public store_args() {
    388         }
    389
    390         public store_args(UserProfile user) {
    391             this();
    392             this.user = user;
    393         }
    394
    395         /**
    396          * Performs a deep copy on <i>other</i>.
    397          */
    398         public store_args(store_args other) {
    399             if (other.isSetUser()) {
    400                 this.user = new UserProfile(other.user);
    401             }
    402         }
    403
    404         public store_args deepCopy() {
    405             return new store_args(this);
    406         }
    407
    408         @Override
    409         public void clear() {
    410             this.user = null;
    411         }
    412
    413         public UserProfile getUser() {
    414             return this.user;
    415         }
    416
    417         public store_args setUser(UserProfile user) {
    418             this.user = user;
    419             return this;
    420         }
    421
    422         public void unsetUser() {
    423             this.user = null;
    424         }
    425
    426         /** Returns true if field user is set (has been assigned a value) and false otherwise */
    427         public boolean isSetUser() {
    428             return this.user != null;
    429         }
    430
    431         public void setUserIsSet(boolean value) {
    432             if (!value) {
    433                 this.user = null;
    434             }
    435         }
    436
    437         public void setFieldValue(_Fields field, Object value) {
    438             switch (field) {
    439             case USER:
    440                 if (value == null) {
    441                     unsetUser();
    442                 } else {
    443                     setUser((UserProfile) value);
    444                 }
    445                 break;
    446
    447             }
    448         }
    449
    450         public Object getFieldValue(_Fields field) {
    451             switch (field) {
    452             case USER:
    453                 return getUser();
    454
    455             }
    456             throw new IllegalStateException();
    457         }
    458
    459         /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    460         public boolean isSet(_Fields field) {
    461             if (field == null) {
    462                 throw new IllegalArgumentException();
    463             }
    464
    465             switch (field) {
    466             case USER:
    467                 return isSetUser();
    468             }
    469             throw new IllegalStateException();
    470         }
    471
    472         @Override
    473         public boolean equals(Object that) {
    474             if (that == null)
    475                 return false;
    476             if (that instanceof store_args)
    477                 return this.equals((store_args) that);
    478             return false;
    479         }
    480
    481         public boolean equals(store_args that) {
    482             if (that == null)
    483                 return false;
    484
    485             boolean this_present_user = true && this.isSetUser();
    486             boolean that_present_user = true && that.isSetUser();
    487             if (this_present_user || that_present_user) {
    488                 if (!(this_present_user && that_present_user))
    489                     return false;
    490                 if (!this.user.equals(that.user))
    491                     return false;
    492             }
    493
    494             return true;
    495         }
    496
    497         @Override
    498         public int hashCode() {
    499             HashCodeBuilder builder = new HashCodeBuilder();
    500
    501             boolean present_user = true && (isSetUser());
    502             builder.append(present_user);
    503             if (present_user)
    504                 builder.append(user);
    505
    506             return builder.toHashCode();
    507         }
    508
    509         public int compareTo(store_args other) {
    510             if (!getClass().equals(other.getClass())) {
    511                 return getClass().getName().compareTo(other.getClass().getName());
    512             }
    513
    514             int lastComparison = 0;
    515             store_args typedOther = other;
    516
    517             lastComparison = Boolean.valueOf(isSetUser()).compareTo(typedOther.isSetUser());
    518             if (lastComparison != 0) {
    519                 return lastComparison;
    520             }
    521             if (isSetUser()) {
    522                 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, typedOther.user);
    523                 if (lastComparison != 0) {
    524                     return lastComparison;
    525                 }
    526             }
    527             return 0;
    528         }
    529
    530         public _Fields fieldForId(int fieldId) {
    531             return _Fields.findByThriftId(fieldId);
    532         }
    533
    534         public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    535             schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    536         }
    537
    538         public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    539             schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    540         }
    541
    542         @Override
    543         public String toString() {
    544             StringBuilder sb = new StringBuilder("store_args(");
    545             boolean first = true;
    546
    547             sb.append("user:");
    548             if (this.user == null) {
    549                 sb.append("null");
    550             } else {
    551                 sb.append(this.user);
    552             }
    553             first = false;
    554             sb.append(")");
    555             return sb.toString();
    556         }
    557
    558         public void validate() throws org.apache.thrift.TException {
    559             // check for required fields
    560             // check for sub-struct validity
    561             if (user != null) {
    562                 user.validate();
    563             }
    564         }
    565
    566         private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    567             try {
    568                 write(new org.apache.thrift.protocol.TCompactProtocol(
    569                         new org.apache.thrift.transport.TIOStreamTransport(out)));
    570             } catch (org.apache.thrift.TException te) {
    571                 throw new java.io.IOException(te);
    572             }
    573         }
    574
    575         private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    576             try {
    577                 read(new org.apache.thrift.protocol.TCompactProtocol(
    578                         new org.apache.thrift.transport.TIOStreamTransport(in)));
    579             } catch (org.apache.thrift.TException te) {
    580                 throw new java.io.IOException(te);
    581             }
    582         }
    583
    584         private static class store_argsStandardSchemeFactory implements SchemeFactory {
    585             public store_argsStandardScheme getScheme() {
    586                 return new store_argsStandardScheme();
    587             }
    588         }
    589
    590         private static class store_argsStandardScheme extends StandardScheme<store_args> {
    591
    592             public void read(org.apache.thrift.protocol.TProtocol iprot, store_args struct)
    593                     throws org.apache.thrift.TException {
    594                 org.apache.thrift.protocol.TField schemeField;
    595                 iprot.readStructBegin();
    596                 while (true) {
    597                     schemeField = iprot.readFieldBegin();
    598                     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
    599                         break;
    600                     }
    601                     switch (schemeField.id) {
    602                     case 1: // USER
    603                         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
    604                             struct.user = new UserProfile();
    605                             struct.user.read(iprot);
    606                             struct.setUserIsSet(true);
    607                         } else {
    608                             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    609                         }
    610                         break;
    611                     default:
    612                         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    613                     }
    614                     iprot.readFieldEnd();
    615                 }
    616                 iprot.readStructEnd();
    617
    618                 // check for required fields of primitive type, which can't be checked in the validate method
    619                 struct.validate();
    620             }
    621
    622             public void write(org.apache.thrift.protocol.TProtocol oprot, store_args struct)
    623                     throws org.apache.thrift.TException {
    624                 struct.validate();
    625
    626                 oprot.writeStructBegin(STRUCT_DESC);
    627                 if (struct.user != null) {
    628                     oprot.writeFieldBegin(USER_FIELD_DESC);
    629                     struct.user.write(oprot);
    630                     oprot.writeFieldEnd();
    631                 }
    632                 oprot.writeFieldStop();
    633                 oprot.writeStructEnd();
    634             }
    635
    636         }
    637
    638         private static class store_argsTupleSchemeFactory implements SchemeFactory {
    639             public store_argsTupleScheme getScheme() {
    640                 return new store_argsTupleScheme();
    641             }
    642         }
    643
    644         private static class store_argsTupleScheme extends TupleScheme<store_args> {
    645
    646             @Override
    647             public void write(org.apache.thrift.protocol.TProtocol prot, store_args struct)
    648                     throws org.apache.thrift.TException {
    649                 TTupleProtocol oprot = (TTupleProtocol) prot;
    650                 BitSet optionals = new BitSet();
    651                 if (struct.isSetUser()) {
    652                     optionals.set(0);
    653                 }
    654                 oprot.writeBitSet(optionals, 1);
    655                 if (struct.isSetUser()) {
    656                     struct.user.write(oprot);
    657                 }
    658             }
    659
    660             @Override
    661             public void read(org.apache.thrift.protocol.TProtocol prot, store_args struct)
    662                     throws org.apache.thrift.TException {
    663                 TTupleProtocol iprot = (TTupleProtocol) prot;
    664                 BitSet incoming = iprot.readBitSet(1);
    665                 if (incoming.get(0)) {
    666                     struct.user = new UserProfile();
    667                     struct.user.read(iprot);
    668                     struct.setUserIsSet(true);
    669                 }
    670             }
    671         }
    672
    673     }
    674
    675     public static class store_result implements org.apache.thrift.TBase<store_result, store_result._Fields>,
    676             java.io.Serializable, Cloneable {
    677         private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct(
    678                 "store_result");
    679
    680         private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    681         static {
    682             schemes.put(StandardScheme.class, new store_resultStandardSchemeFactory());
    683             schemes.put(TupleScheme.class, new store_resultTupleSchemeFactory());
    684         }
    685
    686         /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    687         public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    688             ;
    689
    690             private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
    691
    692             static {
    693                 for (_Fields field : EnumSet.allOf(_Fields.class)) {
    694                     byName.put(field.getFieldName(), field);
    695                 }
    696             }
    697
    698             /**
    699              * Find the _Fields constant that matches fieldId, or null if its not found.
    700              */
    701             public static _Fields findByThriftId(int fieldId) {
    702                 switch (fieldId) {
    703                 default:
    704                     return null;
    705                 }
    706             }
    707
    708             /**
    709              * Find the _Fields constant that matches fieldId, throwing an exception
    710              * if it is not found.
    711              */
    712             public static _Fields findByThriftIdOrThrow(int fieldId) {
    713                 _Fields fields = findByThriftId(fieldId);
    714                 if (fields == null)
    715                     throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
    716                 return fields;
    717             }
    718
    719             /**
    720              * Find the _Fields constant that matches name, or null if its not found.
    721              */
    722             public static _Fields findByName(String name) {
    723                 return byName.get(name);
    724             }
    725
    726             private final short _thriftId;
    727
    728             private final String _fieldName;
    729
    730             _Fields(short thriftId, String fieldName) {
    731                 _thriftId = thriftId;
    732                 _fieldName = fieldName;
    733             }
    734
    735             public short getThriftFieldId() {
    736                 return _thriftId;
    737             }
    738
    739             public String getFieldName() {
    740                 return _fieldName;
    741             }
    742         }
    743
    744         public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    745         static {
    746             Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
    747                     _Fields.class);
    748             metaDataMap = Collections.unmodifiableMap(tmpMap);
    749             org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(store_result.class, metaDataMap);
    750         }
    751
    752         public store_result() {
    753         }
    754
    755         /**
    756          * Performs a deep copy on <i>other</i>.
    757          */
    758         public store_result(store_result other) {
    759         }
    760
    761         public store_result deepCopy() {
    762             return new store_result(this);
    763         }
    764
    765         @Override
    766         public void clear() {
    767         }
    768
    769         public void setFieldValue(_Fields field, Object value) {
    770             switch (field) {
    771             }
    772         }
    773
    774         public Object getFieldValue(_Fields field) {
    775             switch (field) {
    776             }
    777             throw new IllegalStateException();
    778         }
    779
    780         /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    781         public boolean isSet(_Fields field) {
    782             if (field == null) {
    783                 throw new IllegalArgumentException();
    784             }
    785
    786             switch (field) {
    787             }
    788             throw new IllegalStateException();
    789         }
    790
    791         @Override
    792         public boolean equals(Object that) {
    793             if (that == null)
    794                 return false;
    795             if (that instanceof store_result)
    796                 return this.equals((store_result) that);
    797             return false;
    798         }
    799
    800         public boolean equals(store_result that) {
    801             if (that == null)
    802                 return false;
    803
    804             return true;
    805         }
    806
    807         @Override
    808         public int hashCode() {
    809             HashCodeBuilder builder = new HashCodeBuilder();
    810
    811             return builder.toHashCode();
    812         }
    813
    814         public int compareTo(store_result other) {
    815             if (!getClass().equals(other.getClass())) {
    816                 return getClass().getName().compareTo(other.getClass().getName());
    817             }
    818
    819             int lastComparison = 0;
    820             store_result typedOther = other;
    821
    822             return 0;
    823         }
    824
    825         public _Fields fieldForId(int fieldId) {
    826             return _Fields.findByThriftId(fieldId);
    827         }
    828
    829         public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    830             schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    831         }
    832
    833         public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    834             schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    835         }
    836
    837         @Override
    838         public String toString() {
    839             StringBuilder sb = new StringBuilder("store_result(");
    840             boolean first = true;
    841
    842             sb.append(")");
    843             return sb.toString();
    844         }
    845
    846         public void validate() throws org.apache.thrift.TException {
    847             // check for required fields
    848             // check for sub-struct validity
    849         }
    850
    851         private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    852             try {
    853                 write(new org.apache.thrift.protocol.TCompactProtocol(
    854                         new org.apache.thrift.transport.TIOStreamTransport(out)));
    855             } catch (org.apache.thrift.TException te) {
    856                 throw new java.io.IOException(te);
    857             }
    858         }
    859
    860         private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    861             try {
    862                 read(new org.apache.thrift.protocol.TCompactProtocol(
    863                         new org.apache.thrift.transport.TIOStreamTransport(in)));
    864             } catch (org.apache.thrift.TException te) {
    865                 throw new java.io.IOException(te);
    866             }
    867         }
    868
    869         private static class store_resultStandardSchemeFactory implements SchemeFactory {
    870             public store_resultStandardScheme getScheme() {
    871                 return new store_resultStandardScheme();
    872             }
    873         }
    874
    875         private static class store_resultStandardScheme extends StandardScheme<store_result> {
    876
    877             public void read(org.apache.thrift.protocol.TProtocol iprot, store_result struct)
    878                     throws org.apache.thrift.TException {
    879                 org.apache.thrift.protocol.TField schemeField;
    880                 iprot.readStructBegin();
    881                 while (true) {
    882                     schemeField = iprot.readFieldBegin();
    883                     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
    884                         break;
    885                     }
    886                     switch (schemeField.id) {
    887                     default:
    888                         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    889                     }
    890                     iprot.readFieldEnd();
    891                 }
    892                 iprot.readStructEnd();
    893
    894                 // check for required fields of primitive type, which can't be checked in the validate method
    895                 struct.validate();
    896             }
    897
    898             public void write(org.apache.thrift.protocol.TProtocol oprot, store_result struct)
    899                     throws org.apache.thrift.TException {
    900                 struct.validate();
    901
    902                 oprot.writeStructBegin(STRUCT_DESC);
    903                 oprot.writeFieldStop();
    904                 oprot.writeStructEnd();
    905             }
    906
    907         }
    908
    909         private static class store_resultTupleSchemeFactory implements SchemeFactory {
    910             public store_resultTupleScheme getScheme() {
    911                 return new store_resultTupleScheme();
    912             }
    913         }
    914
    915         private static class store_resultTupleScheme extends TupleScheme<store_result> {
    916
    917             @Override
    918             public void write(org.apache.thrift.protocol.TProtocol prot, store_result struct)
    919                     throws org.apache.thrift.TException {
    920                 TTupleProtocol oprot = (TTupleProtocol) prot;
    921             }
    922
    923             @Override
    924             public void read(org.apache.thrift.protocol.TProtocol prot, store_result struct)
    925                     throws org.apache.thrift.TException {
    926                 TTupleProtocol iprot = (TTupleProtocol) prot;
    927             }
    928         }
    929
    930     }
    931
    932     public static class retrieve_args implements org.apache.thrift.TBase<retrieve_args, retrieve_args._Fields>,
    933             java.io.Serializable, Cloneable {
    934         private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct(
    935                 "retrieve_args");
    936
    937         private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField(
    938                 "uid", org.apache.thrift.protocol.TType.I32, (short) 1);
    939
    940         private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    941         static {
    942             schemes.put(StandardScheme.class, new retrieve_argsStandardSchemeFactory());
    943             schemes.put(TupleScheme.class, new retrieve_argsTupleSchemeFactory());
    944         }
    945
    946         public int uid; // required
    947
    948         /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    949         public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    950             UID((short) 1, "uid");
    951
    952             private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
    953
    954             static {
    955                 for (_Fields field : EnumSet.allOf(_Fields.class)) {
    956                     byName.put(field.getFieldName(), field);
    957                 }
    958             }
    959
    960             /**
    961              * Find the _Fields constant that matches fieldId, or null if its not found.
    962              */
    963             public static _Fields findByThriftId(int fieldId) {
    964                 switch (fieldId) {
    965                 case 1: // UID
    966                     return UID;
    967                 default:
    968                     return null;
    969                 }
    970             }
    971
    972             /**
    973              * Find the _Fields constant that matches fieldId, throwing an exception
    974              * if it is not found.
    975              */
    976             public static _Fields findByThriftIdOrThrow(int fieldId) {
    977                 _Fields fields = findByThriftId(fieldId);
    978                 if (fields == null)
    979                     throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
    980                 return fields;
    981             }
    982
    983             /**
    984              * Find the _Fields constant that matches name, or null if its not found.
    985              */
    986             public static _Fields findByName(String name) {
    987                 return byName.get(name);
    988             }
    989
    990             private final short _thriftId;
    991
    992             private final String _fieldName;
    993
    994             _Fields(short thriftId, String fieldName) {
    995                 _thriftId = thriftId;
    996                 _fieldName = fieldName;
    997             }
    998
    999             public short getThriftFieldId() {
    1000                 return _thriftId;
    1001             }
    1002
    1003             public String getFieldName() {
    1004                 return _fieldName;
    1005             }
    1006         }
    1007
    1008         // isset id assignments
    1009         private static final int __UID_ISSET_ID = 0;
    1010
    1011         private byte __isset_bitfield = 0;
    1012
    1013         public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    1014         static {
    1015             Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
    1016                     _Fields.class);
    1017             tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid",
    1018                     org.apache.thrift.TFieldRequirementType.DEFAULT,
    1019                     new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    1020             metaDataMap = Collections.unmodifiableMap(tmpMap);
    1021             org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(retrieve_args.class, metaDataMap);
    1022         }
    1023
    1024         public retrieve_args() {
    1025         }
    1026
    1027         public retrieve_args(int uid) {
    1028             this();
    1029             this.uid = uid;
    1030             setUidIsSet(true);
    1031         }
    1032
    1033         /**
    1034          * Performs a deep copy on <i>other</i>.
    1035          */
    1036         public retrieve_args(retrieve_args other) {
    1037             __isset_bitfield = other.__isset_bitfield;
    1038             this.uid = other.uid;
    1039         }
    1040
    1041         public retrieve_args deepCopy() {
    1042             return new retrieve_args(this);
    1043         }
    1044
    1045         @Override
    1046         public void clear() {
    1047             setUidIsSet(false);
    1048             this.uid = 0;
    1049         }
    1050
    1051         public int getUid() {
    1052             return this.uid;
    1053         }
    1054
    1055         public retrieve_args setUid(int uid) {
    1056             this.uid = uid;
    1057             setUidIsSet(true);
    1058             return this;
    1059         }
    1060
    1061         public void unsetUid() {
    1062             __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID);
    1063         }
    1064
    1065         /** Returns true if field uid is set (has been assigned a value) and false otherwise */
    1066         public boolean isSetUid() {
    1067             return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID);
    1068         }
    1069
    1070         public void setUidIsSet(boolean value) {
    1071             __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value);
    1072         }
    1073
    1074         public void setFieldValue(_Fields field, Object value) {
    1075             switch (field) {
    1076             case UID:
    1077                 if (value == null) {
    1078                     unsetUid();
    1079                 } else {
    1080                     setUid((Integer) value);
    1081                 }
    1082                 break;
    1083
    1084             }
    1085         }
    1086
    1087         public Object getFieldValue(_Fields field) {
    1088             switch (field) {
    1089             case UID:
    1090                 return Integer.valueOf(getUid());
    1091
    1092             }
    1093             throw new IllegalStateException();
    1094         }
    1095
    1096         /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    1097         public boolean isSet(_Fields field) {
    1098             if (field == null) {
    1099                 throw new IllegalArgumentException();
    1100             }
    1101
    1102             switch (field) {
    1103             case UID:
    1104                 return isSetUid();
    1105             }
    1106             throw new IllegalStateException();
    1107         }
    1108
    1109         @Override
    1110         public boolean equals(Object that) {
    1111             if (that == null)
    1112                 return false;
    1113             if (that instanceof retrieve_args)
    1114                 return this.equals((retrieve_args) that);
    1115             return false;
    1116         }
    1117
    1118         public boolean equals(retrieve_args that) {
    1119             if (that == null)
    1120                 return false;
    1121
    1122             boolean this_present_uid = true;
    1123             boolean that_present_uid = true;
    1124             if (this_present_uid || that_present_uid) {
    1125                 if (!(this_present_uid && that_present_uid))
    1126                     return false;
    1127                 if (this.uid != that.uid)
    1128                     return false;
    1129             }
    1130
    1131             return true;
    1132         }
    1133
    1134         @Override
    1135         public int hashCode() {
    1136             HashCodeBuilder builder = new HashCodeBuilder();
    1137
    1138             boolean present_uid = true;
    1139             builder.append(present_uid);
    1140             if (present_uid)
    1141                 builder.append(uid);
    1142
    1143             return builder.toHashCode();
    1144         }
    1145
    1146         public int compareTo(retrieve_args other) {
    1147             if (!getClass().equals(other.getClass())) {
    1148                 return getClass().getName().compareTo(other.getClass().getName());
    1149             }
    1150
    1151             int lastComparison = 0;
    1152             retrieve_args typedOther = other;
    1153
    1154             lastComparison = Boolean.valueOf(isSetUid()).compareTo(typedOther.isSetUid());
    1155             if (lastComparison != 0) {
    1156                 return lastComparison;
    1157             }
    1158             if (isSetUid()) {
    1159                 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, typedOther.uid);
    1160                 if (lastComparison != 0) {
    1161                     return lastComparison;
    1162                 }
    1163             }
    1164             return 0;
    1165         }
    1166
    1167         public _Fields fieldForId(int fieldId) {
    1168             return _Fields.findByThriftId(fieldId);
    1169         }
    1170
    1171         public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    1172             schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    1173         }
    1174
    1175         public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    1176             schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    1177         }
    1178
    1179         @Override
    1180         public String toString() {
    1181             StringBuilder sb = new StringBuilder("retrieve_args(");
    1182             boolean first = true;
    1183
    1184             sb.append("uid:");
    1185             sb.append(this.uid);
    1186             first = false;
    1187             sb.append(")");
    1188             return sb.toString();
    1189         }
    1190
    1191         public void validate() throws org.apache.thrift.TException {
    1192             // check for required fields
    1193             // check for sub-struct validity
    1194         }
    1195
    1196         private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    1197             try {
    1198                 write(new org.apache.thrift.protocol.TCompactProtocol(
    1199                         new org.apache.thrift.transport.TIOStreamTransport(out)));
    1200             } catch (org.apache.thrift.TException te) {
    1201                 throw new java.io.IOException(te);
    1202             }
    1203         }
    1204
    1205         private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    1206             try {
    1207                 // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
    1208                 __isset_bitfield = 0;
    1209                 read(new org.apache.thrift.protocol.TCompactProtocol(
    1210                         new org.apache.thrift.transport.TIOStreamTransport(in)));
    1211             } catch (org.apache.thrift.TException te) {
    1212                 throw new java.io.IOException(te);
    1213             }
    1214         }
    1215
    1216         private static class retrieve_argsStandardSchemeFactory implements SchemeFactory {
    1217             public retrieve_argsStandardScheme getScheme() {
    1218                 return new retrieve_argsStandardScheme();
    1219             }
    1220         }
    1221
    1222         private static class retrieve_argsStandardScheme extends StandardScheme<retrieve_args> {
    1223
    1224             public void read(org.apache.thrift.protocol.TProtocol iprot, retrieve_args struct)
    1225                     throws org.apache.thrift.TException {
    1226                 org.apache.thrift.protocol.TField schemeField;
    1227                 iprot.readStructBegin();
    1228                 while (true) {
    1229                     schemeField = iprot.readFieldBegin();
    1230                     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
    1231                         break;
    1232                     }
    1233                     switch (schemeField.id) {
    1234                     case 1: // UID
    1235                         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
    1236                             struct.uid = iprot.readI32();
    1237                             struct.setUidIsSet(true);
    1238                         } else {
    1239                             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    1240                         }
    1241                         break;
    1242                     default:
    1243                         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    1244                     }
    1245                     iprot.readFieldEnd();
    1246                 }
    1247                 iprot.readStructEnd();
    1248
    1249                 // check for required fields of primitive type, which can't be checked in the validate method
    1250                 struct.validate();
    1251             }
    1252
    1253             public void write(org.apache.thrift.protocol.TProtocol oprot, retrieve_args struct)
    1254                     throws org.apache.thrift.TException {
    1255                 struct.validate();
    1256
    1257                 oprot.writeStructBegin(STRUCT_DESC);
    1258                 oprot.writeFieldBegin(UID_FIELD_DESC);
    1259                 oprot.writeI32(struct.uid);
    1260                 oprot.writeFieldEnd();
    1261                 oprot.writeFieldStop();
    1262                 oprot.writeStructEnd();
    1263             }
    1264
    1265         }
    1266
    1267         private static class retrieve_argsTupleSchemeFactory implements SchemeFactory {
    1268             public retrieve_argsTupleScheme getScheme() {
    1269                 return new retrieve_argsTupleScheme();
    1270             }
    1271         }
    1272
    1273         private static class retrieve_argsTupleScheme extends TupleScheme<retrieve_args> {
    1274
    1275             @Override
    1276             public void write(org.apache.thrift.protocol.TProtocol prot, retrieve_args struct)
    1277                     throws org.apache.thrift.TException {
    1278                 TTupleProtocol oprot = (TTupleProtocol) prot;
    1279                 BitSet optionals = new BitSet();
    1280                 if (struct.isSetUid()) {
    1281                     optionals.set(0);
    1282                 }
    1283                 oprot.writeBitSet(optionals, 1);
    1284                 if (struct.isSetUid()) {
    1285                     oprot.writeI32(struct.uid);
    1286                 }
    1287             }
    1288
    1289             @Override
    1290             public void read(org.apache.thrift.protocol.TProtocol prot, retrieve_args struct)
    1291                     throws org.apache.thrift.TException {
    1292                 TTupleProtocol iprot = (TTupleProtocol) prot;
    1293                 BitSet incoming = iprot.readBitSet(1);
    1294                 if (incoming.get(0)) {
    1295                     struct.uid = iprot.readI32();
    1296                     struct.setUidIsSet(true);
    1297                 }
    1298             }
    1299         }
    1300
    1301     }
    1302
    1303     public static class retrieve_result implements org.apache.thrift.TBase<retrieve_result, retrieve_result._Fields>,
    1304             java.io.Serializable, Cloneable {
    1305         private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct(
    1306                 "retrieve_result");
    1307
    1308         private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField(
    1309                 "success", org.apache.thrift.protocol.TType.STRUCT, (short) 0);
    1310
    1311         private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    1312         static {
    1313             schemes.put(StandardScheme.class, new retrieve_resultStandardSchemeFactory());
    1314             schemes.put(TupleScheme.class, new retrieve_resultTupleSchemeFactory());
    1315         }
    1316
    1317         public UserProfile success; // required
    1318
    1319         /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    1320         public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    1321             SUCCESS((short) 0, "success");
    1322
    1323             private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
    1324
    1325             static {
    1326                 for (_Fields field : EnumSet.allOf(_Fields.class)) {
    1327                     byName.put(field.getFieldName(), field);
    1328                 }
    1329             }
    1330
    1331             /**
    1332              * Find the _Fields constant that matches fieldId, or null if its not found.
    1333              */
    1334             public static _Fields findByThriftId(int fieldId) {
    1335                 switch (fieldId) {
    1336                 case 0: // SUCCESS
    1337                     return SUCCESS;
    1338                 default:
    1339                     return null;
    1340                 }
    1341             }
    1342
    1343             /**
    1344              * Find the _Fields constant that matches fieldId, throwing an exception
    1345              * if it is not found.
    1346              */
    1347             public static _Fields findByThriftIdOrThrow(int fieldId) {
    1348                 _Fields fields = findByThriftId(fieldId);
    1349                 if (fields == null)
    1350                     throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
    1351                 return fields;
    1352             }
    1353
    1354             /**
    1355              * Find the _Fields constant that matches name, or null if its not found.
    1356              */
    1357             public static _Fields findByName(String name) {
    1358                 return byName.get(name);
    1359             }
    1360
    1361             private final short _thriftId;
    1362
    1363             private final String _fieldName;
    1364
    1365             _Fields(short thriftId, String fieldName) {
    1366                 _thriftId = thriftId;
    1367                 _fieldName = fieldName;
    1368             }
    1369
    1370             public short getThriftFieldId() {
    1371                 return _thriftId;
    1372             }
    1373
    1374             public String getFieldName() {
    1375                 return _fieldName;
    1376             }
    1377         }
    1378
    1379         // isset id assignments
    1380         public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    1381         static {
    1382             Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(
    1383                     _Fields.class);
    1384             tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success",
    1385                     org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(
    1386                             org.apache.thrift.protocol.TType.STRUCT, UserProfile.class)));
    1387             metaDataMap = Collections.unmodifiableMap(tmpMap);
    1388             org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(retrieve_result.class, metaDataMap);
    1389         }
    1390
    1391         public retrieve_result() {
    1392         }
    1393
    1394         public retrieve_result(UserProfile success) {
    1395             this();
    1396             this.success = success;
    1397         }
    1398
    1399         /**
    1400          * Performs a deep copy on <i>other</i>.
    1401          */
    1402         public retrieve_result(retrieve_result other) {
    1403             if (other.isSetSuccess()) {
    1404                 this.success = new UserProfile(other.success);
    1405             }
    1406         }
    1407
    1408         public retrieve_result deepCopy() {
    1409             return new retrieve_result(this);
    1410         }
    1411
    1412         @Override
    1413         public void clear() {
    1414             this.success = null;
    1415         }
    1416
    1417         public UserProfile getSuccess() {
    1418             return this.success;
    1419         }
    1420
    1421         public retrieve_result setSuccess(UserProfile success) {
    1422             this.success = success;
    1423             return this;
    1424         }
    1425
    1426         public void unsetSuccess() {
    1427             this.success = null;
    1428         }
    1429
    1430         /** Returns true if field success is set (has been assigned a value) and false otherwise */
    1431         public boolean isSetSuccess() {
    1432             return this.success != null;
    1433         }
    1434
    1435         public void setSuccessIsSet(boolean value) {
    1436             if (!value) {
    1437                 this.success = null;
    1438             }
    1439         }
    1440
    1441         public void setFieldValue(_Fields field, Object value) {
    1442             switch (field) {
    1443             case SUCCESS:
    1444                 if (value == null) {
    1445                     unsetSuccess();
    1446                 } else {
    1447                     setSuccess((UserProfile) value);
    1448                 }
    1449                 break;
    1450
    1451             }
    1452         }
    1453
    1454         public Object getFieldValue(_Fields field) {
    1455             switch (field) {
    1456             case SUCCESS:
    1457                 return getSuccess();
    1458
    1459             }
    1460             throw new IllegalStateException();
    1461         }
    1462
    1463         /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    1464         public boolean isSet(_Fields field) {
    1465             if (field == null) {
    1466                 throw new IllegalArgumentException();
    1467             }
    1468
    1469             switch (field) {
    1470             case SUCCESS:
    1471                 return isSetSuccess();
    1472             }
    1473             throw new IllegalStateException();
    1474         }
    1475
    1476         @Override
    1477         public boolean equals(Object that) {
    1478             if (that == null)
    1479                 return false;
    1480             if (that instanceof retrieve_result)
    1481                 return this.equals((retrieve_result) that);
    1482             return false;
    1483         }
    1484
    1485         public boolean equals(retrieve_result that) {
    1486             if (that == null)
    1487                 return false;
    1488
    1489             boolean this_present_success = true && this.isSetSuccess();
    1490             boolean that_present_success = true && that.isSetSuccess();
    1491             if (this_present_success || that_present_success) {
    1492                 if (!(this_present_success && that_present_success))
    1493                     return false;
    1494                 if (!this.success.equals(that.success))
    1495                     return false;
    1496             }
    1497
    1498             return true;
    1499         }
    1500
    1501         @Override
    1502         public int hashCode() {
    1503             HashCodeBuilder builder = new HashCodeBuilder();
    1504
    1505             boolean present_success = true && (isSetSuccess());
    1506             builder.append(present_success);
    1507             if (present_success)
    1508                 builder.append(success);
    1509
    1510             return builder.toHashCode();
    1511         }
    1512
    1513         public int compareTo(retrieve_result other) {
    1514             if (!getClass().equals(other.getClass())) {
    1515                 return getClass().getName().compareTo(other.getClass().getName());
    1516             }
    1517
    1518             int lastComparison = 0;
    1519             retrieve_result typedOther = other;
    1520
    1521             lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
    1522             if (lastComparison != 0) {
    1523                 return lastComparison;
    1524             }
    1525             if (isSetSuccess()) {
    1526                 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
    1527                 if (lastComparison != 0) {
    1528                     return lastComparison;
    1529                 }
    1530             }
    1531             return 0;
    1532         }
    1533
    1534         public _Fields fieldForId(int fieldId) {
    1535             return _Fields.findByThriftId(fieldId);
    1536         }
    1537
    1538         public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    1539             schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    1540         }
    1541
    1542         public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    1543             schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    1544         }
    1545
    1546         @Override
    1547         public String toString() {
    1548             StringBuilder sb = new StringBuilder("retrieve_result(");
    1549             boolean first = true;
    1550
    1551             sb.append("success:");
    1552             if (this.success == null) {
    1553                 sb.append("null");
    1554             } else {
    1555                 sb.append(this.success);
    1556             }
    1557             first = false;
    1558             sb.append(")");
    1559             return sb.toString();
    1560         }
    1561
    1562         public void validate() throws org.apache.thrift.TException {
    1563             // check for required fields
    1564             // check for sub-struct validity
    1565             if (success != null) {
    1566                 success.validate();
    1567             }
    1568         }
    1569
    1570         private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    1571             try {
    1572                 write(new org.apache.thrift.protocol.TCompactProtocol(
    1573                         new org.apache.thrift.transport.TIOStreamTransport(out)));
    1574             } catch (org.apache.thrift.TException te) {
    1575                 throw new java.io.IOException(te);
    1576             }
    1577         }
    1578
    1579         private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    1580             try {
    1581                 read(new org.apache.thrift.protocol.TCompactProtocol(
    1582                         new org.apache.thrift.transport.TIOStreamTransport(in)));
    1583             } catch (org.apache.thrift.TException te) {
    1584                 throw new java.io.IOException(te);
    1585             }
    1586         }
    1587
    1588         private static class retrieve_resultStandardSchemeFactory implements SchemeFactory {
    1589             public retrieve_resultStandardScheme getScheme() {
    1590                 return new retrieve_resultStandardScheme();
    1591             }
    1592         }
    1593
    1594         private static class retrieve_resultStandardScheme extends StandardScheme<retrieve_result> {
    1595
    1596             public void read(org.apache.thrift.protocol.TProtocol iprot, retrieve_result struct)
    1597                     throws org.apache.thrift.TException {
    1598                 org.apache.thrift.protocol.TField schemeField;
    1599                 iprot.readStructBegin();
    1600                 while (true) {
    1601                     schemeField = iprot.readFieldBegin();
    1602                     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
    1603                         break;
    1604                     }
    1605                     switch (schemeField.id) {
    1606                     case 0: // SUCCESS
    1607                         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
    1608                             struct.success = new UserProfile();
    1609                             struct.success.read(iprot);
    1610                             struct.setSuccessIsSet(true);
    1611                         } else {
    1612                             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    1613                         }
    1614                         break;
    1615                     default:
    1616                         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    1617                     }
    1618                     iprot.readFieldEnd();
    1619                 }
    1620                 iprot.readStructEnd();
    1621
    1622                 // check for required fields of primitive type, which can't be checked in the validate method
    1623                 struct.validate();
    1624             }
    1625
    1626             public void write(org.apache.thrift.protocol.TProtocol oprot, retrieve_result struct)
    1627                     throws org.apache.thrift.TException {
    1628                 struct.validate();
    1629
    1630                 oprot.writeStructBegin(STRUCT_DESC);
    1631                 if (struct.success != null) {
    1632                     oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
    1633                     struct.success.write(oprot);
    1634                     oprot.writeFieldEnd();
    1635                 }
    1636                 oprot.writeFieldStop();
    1637                 oprot.writeStructEnd();
    1638             }
    1639
    1640         }
    1641
    1642         private static class retrieve_resultTupleSchemeFactory implements SchemeFactory {
    1643             public retrieve_resultTupleScheme getScheme() {
    1644                 return new retrieve_resultTupleScheme();
    1645             }
    1646         }
    1647
    1648         private static class retrieve_resultTupleScheme extends TupleScheme<retrieve_result> {
    1649
    1650             @Override
    1651             public void write(org.apache.thrift.protocol.TProtocol prot, retrieve_result struct)
    1652                     throws org.apache.thrift.TException {
    1653                 TTupleProtocol oprot = (TTupleProtocol) prot;
    1654                 BitSet optionals = new BitSet();
    1655                 if (struct.isSetSuccess()) {
    1656                     optionals.set(0);
    1657                 }
    1658                 oprot.writeBitSet(optionals, 1);
    1659                 if (struct.isSetSuccess()) {
    1660                     struct.success.write(oprot);
    1661                 }
    1662             }
    1663
    1664             @Override
    1665             public void read(org.apache.thrift.protocol.TProtocol prot, retrieve_result struct)
    1666                     throws org.apache.thrift.TException {
    1667                 TTupleProtocol iprot = (TTupleProtocol) prot;
    1668                 BitSet incoming = iprot.readBitSet(1);
    1669                 if (incoming.get(0)) {
    1670                     struct.success = new UserProfile();
    1671                     struct.success.read(iprot);
    1672                     struct.setSuccessIsSet(true);
    1673                 }
    1674             }
    1675         }
    1676
    1677     }
    1678
    1679 }