Subversion Repositories SmartDukaan

Rev

Rev 14384 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.dtr;

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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DtrService {

  public interface Iface extends in.shop2020.generic.GenericService.Iface {

    public List<LivePricing> getLatestPricing(long skuBundleId, long source_id) throws org.apache.thrift.TException;

    public void updateLatestPriceForItem(long id) throws org.apache.thrift.TException;

  }

  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {

    public void getLatestPricing(long skuBundleId, long source_id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getLatestPricing_call> resultHandler) throws org.apache.thrift.TException;

    public void updateLatestPriceForItem(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updateLatestPriceForItem_call> resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends in.shop2020.generic.GenericService.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 List<LivePricing> getLatestPricing(long skuBundleId, long source_id) throws org.apache.thrift.TException
    {
      send_getLatestPricing(skuBundleId, source_id);
      return recv_getLatestPricing();
    }

    public void send_getLatestPricing(long skuBundleId, long source_id) throws org.apache.thrift.TException
    {
      getLatestPricing_args args = new getLatestPricing_args();
      args.setSkuBundleId(skuBundleId);
      args.setSource_id(source_id);
      sendBase("getLatestPricing", args);
    }

    public List<LivePricing> recv_getLatestPricing() throws org.apache.thrift.TException
    {
      getLatestPricing_result result = new getLatestPricing_result();
      receiveBase(result, "getLatestPricing");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLatestPricing failed: unknown result");
    }

    public void updateLatestPriceForItem(long id) throws org.apache.thrift.TException
    {
      send_updateLatestPriceForItem(id);
    }

    public void send_updateLatestPriceForItem(long id) throws org.apache.thrift.TException
    {
      updateLatestPriceForItem_args args = new updateLatestPriceForItem_args();
      args.setId(id);
      sendBase("updateLatestPriceForItem", args);
    }

  }
  public static class AsyncClient extends in.shop2020.generic.GenericService.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 getLatestPricing(long skuBundleId, long source_id, org.apache.thrift.async.AsyncMethodCallback<getLatestPricing_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getLatestPricing_call method_call = new getLatestPricing_call(skuBundleId, source_id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getLatestPricing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long skuBundleId;
      private long source_id;
      public getLatestPricing_call(long skuBundleId, long source_id, org.apache.thrift.async.AsyncMethodCallback<getLatestPricing_call> 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.skuBundleId = skuBundleId;
        this.source_id = source_id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLatestPricing", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getLatestPricing_args args = new getLatestPricing_args();
        args.setSkuBundleId(skuBundleId);
        args.setSource_id(source_id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<LivePricing> 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_getLatestPricing();
      }
    }

    public void updateLatestPriceForItem(long id, org.apache.thrift.async.AsyncMethodCallback<updateLatestPriceForItem_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updateLatestPriceForItem_call method_call = new updateLatestPriceForItem_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updateLatestPriceForItem_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public updateLatestPriceForItem_call(long id, org.apache.thrift.async.AsyncMethodCallback<updateLatestPriceForItem_call> 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.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateLatestPriceForItem", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updateLatestPriceForItem_args args = new updateLatestPriceForItem_args();
        args.setId(id);
        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 static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor 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("getLatestPricing", new getLatestPricing());
      processMap.put("updateLatestPriceForItem", new updateLatestPriceForItem());
      return processMap;
    }

    private static class getLatestPricing<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getLatestPricing_args> {
      public getLatestPricing() {
        super("getLatestPricing");
      }

      protected getLatestPricing_args getEmptyArgsInstance() {
        return new getLatestPricing_args();
      }

      protected getLatestPricing_result getResult(I iface, getLatestPricing_args args) throws org.apache.thrift.TException {
        getLatestPricing_result result = new getLatestPricing_result();
        result.success = iface.getLatestPricing(args.skuBundleId, args.source_id);
        return result;
      }
    }

    private static class updateLatestPriceForItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateLatestPriceForItem_args> {
      public updateLatestPriceForItem() {
        super("updateLatestPriceForItem");
      }

      protected updateLatestPriceForItem_args getEmptyArgsInstance() {
        return new updateLatestPriceForItem_args();
      }

      protected org.apache.thrift.TBase getResult(I iface, updateLatestPriceForItem_args args) throws org.apache.thrift.TException {
        iface.updateLatestPriceForItem(args.id);
        return null;
      }
    }

  }

  public static class getLatestPricing_args implements org.apache.thrift.TBase<getLatestPricing_args, getLatestPricing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestPricing_args");

    private static final org.apache.thrift.protocol.TField SKU_BUNDLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("skuBundleId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("source_id", org.apache.thrift.protocol.TType.I64, (short)2);

    private long skuBundleId; // required
    private long source_id; // 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 {
      SKU_BUNDLE_ID((short)1, "skuBundleId"),
      SOURCE_ID((short)2, "source_id");

      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: // SKU_BUNDLE_ID
            return SKU_BUNDLE_ID;
          case 2: // SOURCE_ID
            return SOURCE_ID;
          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 __SKUBUNDLEID_ISSET_ID = 0;
    private static final int __SOURCE_ID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    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.SKU_BUNDLE_ID, new org.apache.thrift.meta_data.FieldMetaData("skuBundleId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("source_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLatestPricing_args.class, metaDataMap);
    }

    public getLatestPricing_args() {
    }

    public getLatestPricing_args(
      long skuBundleId,
      long source_id)
    {
      this();
      this.skuBundleId = skuBundleId;
      setSkuBundleIdIsSet(true);
      this.source_id = source_id;
      setSource_idIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestPricing_args(getLatestPricing_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.skuBundleId = other.skuBundleId;
      this.source_id = other.source_id;
    }

    public getLatestPricing_args deepCopy() {
      return new getLatestPricing_args(this);
    }

    @Override
    public void clear() {
      setSkuBundleIdIsSet(false);
      this.skuBundleId = 0;
      setSource_idIsSet(false);
      this.source_id = 0;
    }

    public long getSkuBundleId() {
      return this.skuBundleId;
    }

    public void setSkuBundleId(long skuBundleId) {
      this.skuBundleId = skuBundleId;
      setSkuBundleIdIsSet(true);
    }

    public void unsetSkuBundleId() {
      __isset_bit_vector.clear(__SKUBUNDLEID_ISSET_ID);
    }

    /** Returns true if field skuBundleId is set (has been assigned a value) and false otherwise */
    public boolean isSetSkuBundleId() {
      return __isset_bit_vector.get(__SKUBUNDLEID_ISSET_ID);
    }

    public void setSkuBundleIdIsSet(boolean value) {
      __isset_bit_vector.set(__SKUBUNDLEID_ISSET_ID, value);
    }

    public long getSource_id() {
      return this.source_id;
    }

    public void setSource_id(long source_id) {
      this.source_id = source_id;
      setSource_idIsSet(true);
    }

    public void unsetSource_id() {
      __isset_bit_vector.clear(__SOURCE_ID_ISSET_ID);
    }

    /** Returns true if field source_id is set (has been assigned a value) and false otherwise */
    public boolean isSetSource_id() {
      return __isset_bit_vector.get(__SOURCE_ID_ISSET_ID);
    }

    public void setSource_idIsSet(boolean value) {
      __isset_bit_vector.set(__SOURCE_ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SKU_BUNDLE_ID:
        if (value == null) {
          unsetSkuBundleId();
        } else {
          setSkuBundleId((Long)value);
        }
        break;

      case SOURCE_ID:
        if (value == null) {
          unsetSource_id();
        } else {
          setSource_id((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SKU_BUNDLE_ID:
        return Long.valueOf(getSkuBundleId());

      case SOURCE_ID:
        return Long.valueOf(getSource_id());

      }
      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 SKU_BUNDLE_ID:
        return isSetSkuBundleId();
      case SOURCE_ID:
        return isSetSource_id();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getLatestPricing_args)
        return this.equals((getLatestPricing_args)that);
      return false;
    }

    public boolean equals(getLatestPricing_args that) {
      if (that == null)
        return false;

      boolean this_present_skuBundleId = true;
      boolean that_present_skuBundleId = true;
      if (this_present_skuBundleId || that_present_skuBundleId) {
        if (!(this_present_skuBundleId && that_present_skuBundleId))
          return false;
        if (this.skuBundleId != that.skuBundleId)
          return false;
      }

      boolean this_present_source_id = true;
      boolean that_present_source_id = true;
      if (this_present_source_id || that_present_source_id) {
        if (!(this_present_source_id && that_present_source_id))
          return false;
        if (this.source_id != that.source_id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getLatestPricing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestPricing_args typedOther = (getLatestPricing_args)other;

      lastComparison = Boolean.valueOf(isSetSkuBundleId()).compareTo(typedOther.isSetSkuBundleId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSkuBundleId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skuBundleId, typedOther.skuBundleId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSource_id()).compareTo(typedOther.isSetSource_id());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSource_id()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_id, typedOther.source_id);
        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 {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // SKU_BUNDLE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.skuBundleId = iprot.readI64();
              setSkuBundleIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // SOURCE_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.source_id = iprot.readI64();
              setSource_idIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(SKU_BUNDLE_ID_FIELD_DESC);
      oprot.writeI64(this.skuBundleId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(SOURCE_ID_FIELD_DESC);
      oprot.writeI64(this.source_id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestPricing_args(");
      boolean first = true;

      sb.append("skuBundleId:");
      sb.append(this.skuBundleId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("source_id:");
      sb.append(this.source_id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    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_bit_vector = new BitSet(1);
        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);
      }
    }

  }

  public static class getLatestPricing_result implements org.apache.thrift.TBase<getLatestPricing_result, getLatestPricing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLatestPricing_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<LivePricing> 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.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LivePricing.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLatestPricing_result.class, metaDataMap);
    }

    public getLatestPricing_result() {
    }

    public getLatestPricing_result(
      List<LivePricing> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getLatestPricing_result(getLatestPricing_result other) {
      if (other.isSetSuccess()) {
        List<LivePricing> __this__success = new ArrayList<LivePricing>();
        for (LivePricing other_element : other.success) {
          __this__success.add(new LivePricing(other_element));
        }
        this.success = __this__success;
      }
    }

    public getLatestPricing_result deepCopy() {
      return new getLatestPricing_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<LivePricing> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(LivePricing elem) {
      if (this.success == null) {
        this.success = new ArrayList<LivePricing>();
      }
      this.success.add(elem);
    }

    public List<LivePricing> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<LivePricing> success) {
      this.success = success;
    }

    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((List<LivePricing>)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 getLatestPricing_result)
        return this.equals((getLatestPricing_result)that);
      return false;
    }

    public boolean equals(getLatestPricing_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() {
      return 0;
    }

    public int compareTo(getLatestPricing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getLatestPricing_result typedOther = (getLatestPricing_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.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 {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                this.success = new ArrayList<LivePricing>(_list0.size);
                for (int _i1 = 0; _i1 < _list0.size; ++_i1)
                {
                  LivePricing _elem2; // required
                  _elem2 = new LivePricing();
                  _elem2.read(iprot);
                  this.success.add(_elem2);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (LivePricing _iter3 : this.success)
          {
            _iter3.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getLatestPricing_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
    }

    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);
      }
    }

  }

  public static class updateLatestPriceForItem_args implements org.apache.thrift.TBase<updateLatestPriceForItem_args, updateLatestPriceForItem_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLatestPriceForItem_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // 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 {
      ID((short)1, "id");

      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: // ID
            return ID;
          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 __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateLatestPriceForItem_args.class, metaDataMap);
    }

    public updateLatestPriceForItem_args() {
    }

    public updateLatestPriceForItem_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updateLatestPriceForItem_args(updateLatestPriceForItem_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public updateLatestPriceForItem_args deepCopy() {
      return new updateLatestPriceForItem_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      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 ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updateLatestPriceForItem_args)
        return this.equals((updateLatestPriceForItem_args)that);
      return false;
    }

    public boolean equals(updateLatestPriceForItem_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updateLatestPriceForItem_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updateLatestPriceForItem_args typedOther = (updateLatestPriceForItem_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        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 {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updateLatestPriceForItem_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    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_bit_vector = new BitSet(1);
        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);
      }
    }

  }

}