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.catalog;

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

  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField MFN_FIELD_DESC = new org.apache.thrift.protocol.TField("mfn", org.apache.thrift.protocol.TType.BOOL, (short)2);
  private static final org.apache.thrift.protocol.TField FBA_FIELD_DESC = new org.apache.thrift.protocol.TField("fba", org.apache.thrift.protocol.TType.BOOL, (short)3);
  private static final org.apache.thrift.protocol.TField FBB_FIELD_DESC = new org.apache.thrift.protocol.TField("fbb", org.apache.thrift.protocol.TType.BOOL, (short)4);

  private long item_id; // required
  private boolean mfn; // required
  private boolean fba; // required
  private boolean fbb; // 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 {
    ITEM_ID((short)1, "item_id"),
    MFN((short)2, "mfn"),
    FBA((short)3, "fba"),
    FBB((short)4, "fbb");

    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: // ITEM_ID
          return ITEM_ID;
        case 2: // MFN
          return MFN;
        case 3: // FBA
          return FBA;
        case 4: // FBB
          return FBB;
        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 __ITEM_ID_ISSET_ID = 0;
  private static final int __MFN_ISSET_ID = 1;
  private static final int __FBA_ISSET_ID = 2;
  private static final int __FBB_ISSET_ID = 3;
  private BitSet __isset_bit_vector = new BitSet(4);

  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.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.MFN, new org.apache.thrift.meta_data.FieldMetaData("mfn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.FBA, new org.apache.thrift.meta_data.FieldMetaData("fba", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.FBB, new org.apache.thrift.meta_data.FieldMetaData("fbb", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonOutOfSync.class, metaDataMap);
  }

  public AmazonOutOfSync() {
  }

  public AmazonOutOfSync(
    long item_id,
    boolean mfn,
    boolean fba,
    boolean fbb)
  {
    this();
    this.item_id = item_id;
    setItem_idIsSet(true);
    this.mfn = mfn;
    setMfnIsSet(true);
    this.fba = fba;
    setFbaIsSet(true);
    this.fbb = fbb;
    setFbbIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public AmazonOutOfSync(AmazonOutOfSync other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.item_id = other.item_id;
    this.mfn = other.mfn;
    this.fba = other.fba;
    this.fbb = other.fbb;
  }

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

  @Override
  public void clear() {
    setItem_idIsSet(false);
    this.item_id = 0;
    setMfnIsSet(false);
    this.mfn = false;
    setFbaIsSet(false);
    this.fba = false;
    setFbbIsSet(false);
    this.fbb = false;
  }

  public long getItem_id() {
    return this.item_id;
  }

  public void setItem_id(long item_id) {
    this.item_id = item_id;
    setItem_idIsSet(true);
  }

  public void unsetItem_id() {
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
  }

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

  public void setItem_idIsSet(boolean value) {
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
  }

  public boolean isMfn() {
    return this.mfn;
  }

  public void setMfn(boolean mfn) {
    this.mfn = mfn;
    setMfnIsSet(true);
  }

  public void unsetMfn() {
    __isset_bit_vector.clear(__MFN_ISSET_ID);
  }

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

  public void setMfnIsSet(boolean value) {
    __isset_bit_vector.set(__MFN_ISSET_ID, value);
  }

  public boolean isFba() {
    return this.fba;
  }

  public void setFba(boolean fba) {
    this.fba = fba;
    setFbaIsSet(true);
  }

  public void unsetFba() {
    __isset_bit_vector.clear(__FBA_ISSET_ID);
  }

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

  public void setFbaIsSet(boolean value) {
    __isset_bit_vector.set(__FBA_ISSET_ID, value);
  }

  public boolean isFbb() {
    return this.fbb;
  }

  public void setFbb(boolean fbb) {
    this.fbb = fbb;
    setFbbIsSet(true);
  }

  public void unsetFbb() {
    __isset_bit_vector.clear(__FBB_ISSET_ID);
  }

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

  public void setFbbIsSet(boolean value) {
    __isset_bit_vector.set(__FBB_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ITEM_ID:
      if (value == null) {
        unsetItem_id();
      } else {
        setItem_id((Long)value);
      }
      break;

    case MFN:
      if (value == null) {
        unsetMfn();
      } else {
        setMfn((Boolean)value);
      }
      break;

    case FBA:
      if (value == null) {
        unsetFba();
      } else {
        setFba((Boolean)value);
      }
      break;

    case FBB:
      if (value == null) {
        unsetFbb();
      } else {
        setFbb((Boolean)value);
      }
      break;

    }
  }

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

    case MFN:
      return Boolean.valueOf(isMfn());

    case FBA:
      return Boolean.valueOf(isFba());

    case FBB:
      return Boolean.valueOf(isFbb());

    }
    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 ITEM_ID:
      return isSetItem_id();
    case MFN:
      return isSetMfn();
    case FBA:
      return isSetFba();
    case FBB:
      return isSetFbb();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_item_id = true;
    boolean that_present_item_id = true;
    if (this_present_item_id || that_present_item_id) {
      if (!(this_present_item_id && that_present_item_id))
        return false;
      if (this.item_id != that.item_id)
        return false;
    }

    boolean this_present_mfn = true;
    boolean that_present_mfn = true;
    if (this_present_mfn || that_present_mfn) {
      if (!(this_present_mfn && that_present_mfn))
        return false;
      if (this.mfn != that.mfn)
        return false;
    }

    boolean this_present_fba = true;
    boolean that_present_fba = true;
    if (this_present_fba || that_present_fba) {
      if (!(this_present_fba && that_present_fba))
        return false;
      if (this.fba != that.fba)
        return false;
    }

    boolean this_present_fbb = true;
    boolean that_present_fbb = true;
    if (this_present_fbb || that_present_fbb) {
      if (!(this_present_fbb && that_present_fbb))
        return false;
      if (this.fbb != that.fbb)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetItem_id()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMfn()).compareTo(typedOther.isSetMfn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMfn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mfn, typedOther.mfn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFba()).compareTo(typedOther.isSetFba());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFba()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fba, typedOther.fba);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFbb()).compareTo(typedOther.isSetFbb());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFbb()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fbb, typedOther.fbb);
      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: // ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.item_id = iprot.readI64();
            setItem_idIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // MFN
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.mfn = iprot.readBool();
            setMfnIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // FBA
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.fba = iprot.readBool();
            setFbaIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // FBB
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.fbb = iprot.readBool();
            setFbbIsSet(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(ITEM_ID_FIELD_DESC);
    oprot.writeI64(this.item_id);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MFN_FIELD_DESC);
    oprot.writeBool(this.mfn);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(FBA_FIELD_DESC);
    oprot.writeBool(this.fba);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(FBB_FIELD_DESC);
    oprot.writeBool(this.fbb);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("item_id:");
    sb.append(this.item_id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("mfn:");
    sb.append(this.mfn);
    first = false;
    if (!first) sb.append(", ");
    sb.append("fba:");
    sb.append(this.fba);
    first = false;
    if (!first) sb.append(", ");
    sb.append("fbb:");
    sb.append(this.fbb);
    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);
    }
  }

}