Subversion Repositories SmartDukaan

Rev

Blame | 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.order;

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 AmazonOrdersToAcknowledge implements org.apache.thrift.TBase<AmazonOrdersToAcknowledge, AmazonOrdersToAcknowledge._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AmazonOrdersToAcknowledge");

  private static final org.apache.thrift.protocol.TField AMAZON_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonOrderId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField AMAZON_ORDER_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonOrderItemId", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction_id", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)5);

  private String amazonOrderId; // required
  private String amazonOrderItemId; // required
  private String status; // required
  private long transaction_id; // required
  private int count; // 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 {
    AMAZON_ORDER_ID((short)1, "amazonOrderId"),
    AMAZON_ORDER_ITEM_ID((short)2, "amazonOrderItemId"),
    STATUS((short)3, "status"),
    TRANSACTION_ID((short)4, "transaction_id"),
    COUNT((short)5, "count");

    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: // AMAZON_ORDER_ID
          return AMAZON_ORDER_ID;
        case 2: // AMAZON_ORDER_ITEM_ID
          return AMAZON_ORDER_ITEM_ID;
        case 3: // STATUS
          return STATUS;
        case 4: // TRANSACTION_ID
          return TRANSACTION_ID;
        case 5: // COUNT
          return COUNT;
        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 __TRANSACTION_ID_ISSET_ID = 0;
  private static final int __COUNT_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.AMAZON_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("amazonOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.AMAZON_ORDER_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("amazonOrderItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transaction_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COUNT, new org.apache.thrift.meta_data.FieldMetaData("count", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonOrdersToAcknowledge.class, metaDataMap);
  }

  public AmazonOrdersToAcknowledge() {
  }

  public AmazonOrdersToAcknowledge(
    String amazonOrderId,
    String amazonOrderItemId,
    String status,
    long transaction_id,
    int count)
  {
    this();
    this.amazonOrderId = amazonOrderId;
    this.amazonOrderItemId = amazonOrderItemId;
    this.status = status;
    this.transaction_id = transaction_id;
    setTransaction_idIsSet(true);
    this.count = count;
    setCountIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public AmazonOrdersToAcknowledge(AmazonOrdersToAcknowledge other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetAmazonOrderId()) {
      this.amazonOrderId = other.amazonOrderId;
    }
    if (other.isSetAmazonOrderItemId()) {
      this.amazonOrderItemId = other.amazonOrderItemId;
    }
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    this.transaction_id = other.transaction_id;
    this.count = other.count;
  }

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

  @Override
  public void clear() {
    this.amazonOrderId = null;
    this.amazonOrderItemId = null;
    this.status = null;
    setTransaction_idIsSet(false);
    this.transaction_id = 0;
    setCountIsSet(false);
    this.count = 0;
  }

  public String getAmazonOrderId() {
    return this.amazonOrderId;
  }

  public void setAmazonOrderId(String amazonOrderId) {
    this.amazonOrderId = amazonOrderId;
  }

  public void unsetAmazonOrderId() {
    this.amazonOrderId = null;
  }

  /** Returns true if field amazonOrderId is set (has been assigned a value) and false otherwise */
  public boolean isSetAmazonOrderId() {
    return this.amazonOrderId != null;
  }

  public void setAmazonOrderIdIsSet(boolean value) {
    if (!value) {
      this.amazonOrderId = null;
    }
  }

  public String getAmazonOrderItemId() {
    return this.amazonOrderItemId;
  }

  public void setAmazonOrderItemId(String amazonOrderItemId) {
    this.amazonOrderItemId = amazonOrderItemId;
  }

  public void unsetAmazonOrderItemId() {
    this.amazonOrderItemId = null;
  }

  /** Returns true if field amazonOrderItemId is set (has been assigned a value) and false otherwise */
  public boolean isSetAmazonOrderItemId() {
    return this.amazonOrderItemId != null;
  }

  public void setAmazonOrderItemIdIsSet(boolean value) {
    if (!value) {
      this.amazonOrderItemId = null;
    }
  }

  public String getStatus() {
    return this.status;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public void unsetStatus() {
    this.status = null;
  }

  /** Returns true if field status is set (has been assigned a value) and false otherwise */
  public boolean isSetStatus() {
    return this.status != null;
  }

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

  public long getTransaction_id() {
    return this.transaction_id;
  }

  public void setTransaction_id(long transaction_id) {
    this.transaction_id = transaction_id;
    setTransaction_idIsSet(true);
  }

  public void unsetTransaction_id() {
    __isset_bit_vector.clear(__TRANSACTION_ID_ISSET_ID);
  }

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

  public void setTransaction_idIsSet(boolean value) {
    __isset_bit_vector.set(__TRANSACTION_ID_ISSET_ID, value);
  }

  public int getCount() {
    return this.count;
  }

  public void setCount(int count) {
    this.count = count;
    setCountIsSet(true);
  }

  public void unsetCount() {
    __isset_bit_vector.clear(__COUNT_ISSET_ID);
  }

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

  public void setCountIsSet(boolean value) {
    __isset_bit_vector.set(__COUNT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case AMAZON_ORDER_ID:
      if (value == null) {
        unsetAmazonOrderId();
      } else {
        setAmazonOrderId((String)value);
      }
      break;

    case AMAZON_ORDER_ITEM_ID:
      if (value == null) {
        unsetAmazonOrderItemId();
      } else {
        setAmazonOrderItemId((String)value);
      }
      break;

    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((String)value);
      }
      break;

    case TRANSACTION_ID:
      if (value == null) {
        unsetTransaction_id();
      } else {
        setTransaction_id((Long)value);
      }
      break;

    case COUNT:
      if (value == null) {
        unsetCount();
      } else {
        setCount((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case AMAZON_ORDER_ID:
      return getAmazonOrderId();

    case AMAZON_ORDER_ITEM_ID:
      return getAmazonOrderItemId();

    case STATUS:
      return getStatus();

    case TRANSACTION_ID:
      return Long.valueOf(getTransaction_id());

    case COUNT:
      return Integer.valueOf(getCount());

    }
    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 AMAZON_ORDER_ID:
      return isSetAmazonOrderId();
    case AMAZON_ORDER_ITEM_ID:
      return isSetAmazonOrderItemId();
    case STATUS:
      return isSetStatus();
    case TRANSACTION_ID:
      return isSetTransaction_id();
    case COUNT:
      return isSetCount();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_amazonOrderId = true && this.isSetAmazonOrderId();
    boolean that_present_amazonOrderId = true && that.isSetAmazonOrderId();
    if (this_present_amazonOrderId || that_present_amazonOrderId) {
      if (!(this_present_amazonOrderId && that_present_amazonOrderId))
        return false;
      if (!this.amazonOrderId.equals(that.amazonOrderId))
        return false;
    }

    boolean this_present_amazonOrderItemId = true && this.isSetAmazonOrderItemId();
    boolean that_present_amazonOrderItemId = true && that.isSetAmazonOrderItemId();
    if (this_present_amazonOrderItemId || that_present_amazonOrderItemId) {
      if (!(this_present_amazonOrderItemId && that_present_amazonOrderItemId))
        return false;
      if (!this.amazonOrderItemId.equals(that.amazonOrderItemId))
        return false;
    }

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_transaction_id = true;
    boolean that_present_transaction_id = true;
    if (this_present_transaction_id || that_present_transaction_id) {
      if (!(this_present_transaction_id && that_present_transaction_id))
        return false;
      if (this.transaction_id != that.transaction_id)
        return false;
    }

    boolean this_present_count = true;
    boolean that_present_count = true;
    if (this_present_count || that_present_count) {
      if (!(this_present_count && that_present_count))
        return false;
      if (this.count != that.count)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetAmazonOrderId()).compareTo(typedOther.isSetAmazonOrderId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAmazonOrderId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonOrderId, typedOther.amazonOrderId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAmazonOrderItemId()).compareTo(typedOther.isSetAmazonOrderItemId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAmazonOrderItemId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonOrderItemId, typedOther.amazonOrderItemId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTransaction_id()).compareTo(typedOther.isSetTransaction_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransaction_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction_id, typedOther.transaction_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.count, typedOther.count);
      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: // AMAZON_ORDER_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.amazonOrderId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // AMAZON_ORDER_ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.amazonOrderItemId = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // STATUS
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.status = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // TRANSACTION_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.transaction_id = iprot.readI64();
            setTransaction_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // COUNT
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.count = iprot.readI32();
            setCountIsSet(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);
    if (this.amazonOrderId != null) {
      oprot.writeFieldBegin(AMAZON_ORDER_ID_FIELD_DESC);
      oprot.writeString(this.amazonOrderId);
      oprot.writeFieldEnd();
    }
    if (this.amazonOrderItemId != null) {
      oprot.writeFieldBegin(AMAZON_ORDER_ITEM_ID_FIELD_DESC);
      oprot.writeString(this.amazonOrderItemId);
      oprot.writeFieldEnd();
    }
    if (this.status != null) {
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
      oprot.writeString(this.status);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
    oprot.writeI64(this.transaction_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(COUNT_FIELD_DESC);
    oprot.writeI32(this.count);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("amazonOrderId:");
    if (this.amazonOrderId == null) {
      sb.append("null");
    } else {
      sb.append(this.amazonOrderId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("amazonOrderItemId:");
    if (this.amazonOrderItemId == null) {
      sb.append("null");
    } else {
      sb.append(this.amazonOrderItemId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("transaction_id:");
    sb.append(this.transaction_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("count:");
    sb.append(this.count);
    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);
    }
  }

}