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

  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField AFFILIATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateId", org.apache.thrift.protocol.TType.I64, (short)2);
  private static final org.apache.thrift.protocol.TField AFFILIATE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateName", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField OFFER_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("offerText", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField OFFER_IMAGE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("offerImageUrl", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField M_OFFER_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("mOfferText", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField M_OFFER_IMAGE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("mOfferImageUrl", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField AFFILIATE_SKU_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateSku", org.apache.thrift.protocol.TType.STRING, (short)8);
  private static final org.apache.thrift.protocol.TField AFFILIATE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateUrl", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("active", org.apache.thrift.protocol.TType.BOOL, (short)10);

  private long itemId; // required
  private long affiliateId; // required
  private String affiliateName; // required
  private String offerText; // required
  private String offerImageUrl; // required
  private String mOfferText; // required
  private String mOfferImageUrl; // required
  private String affiliateSku; // required
  private String affiliateUrl; // required
  private boolean active; // 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, "itemId"),
    AFFILIATE_ID((short)2, "affiliateId"),
    AFFILIATE_NAME((short)3, "affiliateName"),
    OFFER_TEXT((short)4, "offerText"),
    OFFER_IMAGE_URL((short)5, "offerImageUrl"),
    M_OFFER_TEXT((short)6, "mOfferText"),
    M_OFFER_IMAGE_URL((short)7, "mOfferImageUrl"),
    AFFILIATE_SKU((short)8, "affiliateSku"),
    AFFILIATE_URL((short)9, "affiliateUrl"),
    ACTIVE((short)10, "active");

    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: // AFFILIATE_ID
          return AFFILIATE_ID;
        case 3: // AFFILIATE_NAME
          return AFFILIATE_NAME;
        case 4: // OFFER_TEXT
          return OFFER_TEXT;
        case 5: // OFFER_IMAGE_URL
          return OFFER_IMAGE_URL;
        case 6: // M_OFFER_TEXT
          return M_OFFER_TEXT;
        case 7: // M_OFFER_IMAGE_URL
          return M_OFFER_IMAGE_URL;
        case 8: // AFFILIATE_SKU
          return AFFILIATE_SKU;
        case 9: // AFFILIATE_URL
          return AFFILIATE_URL;
        case 10: // ACTIVE
          return ACTIVE;
        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 __ITEMID_ISSET_ID = 0;
  private static final int __AFFILIATEID_ISSET_ID = 1;
  private static final int __ACTIVE_ISSET_ID = 2;
  private BitSet __isset_bit_vector = new BitSet(3);

  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("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AFFILIATE_ID, new org.apache.thrift.meta_data.FieldMetaData("affiliateId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.AFFILIATE_NAME, new org.apache.thrift.meta_data.FieldMetaData("affiliateName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OFFER_TEXT, new org.apache.thrift.meta_data.FieldMetaData("offerText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OFFER_IMAGE_URL, new org.apache.thrift.meta_data.FieldMetaData("offerImageUrl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.M_OFFER_TEXT, new org.apache.thrift.meta_data.FieldMetaData("mOfferText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.M_OFFER_IMAGE_URL, new org.apache.thrift.meta_data.FieldMetaData("mOfferImageUrl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.AFFILIATE_SKU, new org.apache.thrift.meta_data.FieldMetaData("affiliateSku", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.AFFILIATE_URL, new org.apache.thrift.meta_data.FieldMetaData("affiliateUrl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("active", 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(ExclusiveAffiliateItemInfo.class, metaDataMap);
  }

  public ExclusiveAffiliateItemInfo() {
  }

  public ExclusiveAffiliateItemInfo(
    long itemId,
    long affiliateId,
    String affiliateName,
    String offerText,
    String offerImageUrl,
    String mOfferText,
    String mOfferImageUrl,
    String affiliateSku,
    String affiliateUrl,
    boolean active)
  {
    this();
    this.itemId = itemId;
    setItemIdIsSet(true);
    this.affiliateId = affiliateId;
    setAffiliateIdIsSet(true);
    this.affiliateName = affiliateName;
    this.offerText = offerText;
    this.offerImageUrl = offerImageUrl;
    this.mOfferText = mOfferText;
    this.mOfferImageUrl = mOfferImageUrl;
    this.affiliateSku = affiliateSku;
    this.affiliateUrl = affiliateUrl;
    this.active = active;
    setActiveIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ExclusiveAffiliateItemInfo(ExclusiveAffiliateItemInfo other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.itemId = other.itemId;
    this.affiliateId = other.affiliateId;
    if (other.isSetAffiliateName()) {
      this.affiliateName = other.affiliateName;
    }
    if (other.isSetOfferText()) {
      this.offerText = other.offerText;
    }
    if (other.isSetOfferImageUrl()) {
      this.offerImageUrl = other.offerImageUrl;
    }
    if (other.isSetMOfferText()) {
      this.mOfferText = other.mOfferText;
    }
    if (other.isSetMOfferImageUrl()) {
      this.mOfferImageUrl = other.mOfferImageUrl;
    }
    if (other.isSetAffiliateSku()) {
      this.affiliateSku = other.affiliateSku;
    }
    if (other.isSetAffiliateUrl()) {
      this.affiliateUrl = other.affiliateUrl;
    }
    this.active = other.active;
  }

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

  @Override
  public void clear() {
    setItemIdIsSet(false);
    this.itemId = 0;
    setAffiliateIdIsSet(false);
    this.affiliateId = 0;
    this.affiliateName = null;
    this.offerText = null;
    this.offerImageUrl = null;
    this.mOfferText = null;
    this.mOfferImageUrl = null;
    this.affiliateSku = null;
    this.affiliateUrl = null;
    setActiveIsSet(false);
    this.active = false;
  }

  public long getItemId() {
    return this.itemId;
  }

  public void setItemId(long itemId) {
    this.itemId = itemId;
    setItemIdIsSet(true);
  }

  public void unsetItemId() {
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
  }

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

  public void setItemIdIsSet(boolean value) {
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
  }

  public long getAffiliateId() {
    return this.affiliateId;
  }

  public void setAffiliateId(long affiliateId) {
    this.affiliateId = affiliateId;
    setAffiliateIdIsSet(true);
  }

  public void unsetAffiliateId() {
    __isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);
  }

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

  public void setAffiliateIdIsSet(boolean value) {
    __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
  }

  public String getAffiliateName() {
    return this.affiliateName;
  }

  public void setAffiliateName(String affiliateName) {
    this.affiliateName = affiliateName;
  }

  public void unsetAffiliateName() {
    this.affiliateName = null;
  }

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

  public void setAffiliateNameIsSet(boolean value) {
    if (!value) {
      this.affiliateName = null;
    }
  }

  public String getOfferText() {
    return this.offerText;
  }

  public void setOfferText(String offerText) {
    this.offerText = offerText;
  }

  public void unsetOfferText() {
    this.offerText = null;
  }

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

  public void setOfferTextIsSet(boolean value) {
    if (!value) {
      this.offerText = null;
    }
  }

  public String getOfferImageUrl() {
    return this.offerImageUrl;
  }

  public void setOfferImageUrl(String offerImageUrl) {
    this.offerImageUrl = offerImageUrl;
  }

  public void unsetOfferImageUrl() {
    this.offerImageUrl = null;
  }

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

  public void setOfferImageUrlIsSet(boolean value) {
    if (!value) {
      this.offerImageUrl = null;
    }
  }

  public String getMOfferText() {
    return this.mOfferText;
  }

  public void setMOfferText(String mOfferText) {
    this.mOfferText = mOfferText;
  }

  public void unsetMOfferText() {
    this.mOfferText = null;
  }

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

  public void setMOfferTextIsSet(boolean value) {
    if (!value) {
      this.mOfferText = null;
    }
  }

  public String getMOfferImageUrl() {
    return this.mOfferImageUrl;
  }

  public void setMOfferImageUrl(String mOfferImageUrl) {
    this.mOfferImageUrl = mOfferImageUrl;
  }

  public void unsetMOfferImageUrl() {
    this.mOfferImageUrl = null;
  }

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

  public void setMOfferImageUrlIsSet(boolean value) {
    if (!value) {
      this.mOfferImageUrl = null;
    }
  }

  public String getAffiliateSku() {
    return this.affiliateSku;
  }

  public void setAffiliateSku(String affiliateSku) {
    this.affiliateSku = affiliateSku;
  }

  public void unsetAffiliateSku() {
    this.affiliateSku = null;
  }

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

  public void setAffiliateSkuIsSet(boolean value) {
    if (!value) {
      this.affiliateSku = null;
    }
  }

  public String getAffiliateUrl() {
    return this.affiliateUrl;
  }

  public void setAffiliateUrl(String affiliateUrl) {
    this.affiliateUrl = affiliateUrl;
  }

  public void unsetAffiliateUrl() {
    this.affiliateUrl = null;
  }

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

  public void setAffiliateUrlIsSet(boolean value) {
    if (!value) {
      this.affiliateUrl = null;
    }
  }

  public boolean isActive() {
    return this.active;
  }

  public void setActive(boolean active) {
    this.active = active;
    setActiveIsSet(true);
  }

  public void unsetActive() {
    __isset_bit_vector.clear(__ACTIVE_ISSET_ID);
  }

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

  public void setActiveIsSet(boolean value) {
    __isset_bit_vector.set(__ACTIVE_ISSET_ID, value);
  }

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

    case AFFILIATE_ID:
      if (value == null) {
        unsetAffiliateId();
      } else {
        setAffiliateId((Long)value);
      }
      break;

    case AFFILIATE_NAME:
      if (value == null) {
        unsetAffiliateName();
      } else {
        setAffiliateName((String)value);
      }
      break;

    case OFFER_TEXT:
      if (value == null) {
        unsetOfferText();
      } else {
        setOfferText((String)value);
      }
      break;

    case OFFER_IMAGE_URL:
      if (value == null) {
        unsetOfferImageUrl();
      } else {
        setOfferImageUrl((String)value);
      }
      break;

    case M_OFFER_TEXT:
      if (value == null) {
        unsetMOfferText();
      } else {
        setMOfferText((String)value);
      }
      break;

    case M_OFFER_IMAGE_URL:
      if (value == null) {
        unsetMOfferImageUrl();
      } else {
        setMOfferImageUrl((String)value);
      }
      break;

    case AFFILIATE_SKU:
      if (value == null) {
        unsetAffiliateSku();
      } else {
        setAffiliateSku((String)value);
      }
      break;

    case AFFILIATE_URL:
      if (value == null) {
        unsetAffiliateUrl();
      } else {
        setAffiliateUrl((String)value);
      }
      break;

    case ACTIVE:
      if (value == null) {
        unsetActive();
      } else {
        setActive((Boolean)value);
      }
      break;

    }
  }

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

    case AFFILIATE_ID:
      return Long.valueOf(getAffiliateId());

    case AFFILIATE_NAME:
      return getAffiliateName();

    case OFFER_TEXT:
      return getOfferText();

    case OFFER_IMAGE_URL:
      return getOfferImageUrl();

    case M_OFFER_TEXT:
      return getMOfferText();

    case M_OFFER_IMAGE_URL:
      return getMOfferImageUrl();

    case AFFILIATE_SKU:
      return getAffiliateSku();

    case AFFILIATE_URL:
      return getAffiliateUrl();

    case ACTIVE:
      return Boolean.valueOf(isActive());

    }
    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 isSetItemId();
    case AFFILIATE_ID:
      return isSetAffiliateId();
    case AFFILIATE_NAME:
      return isSetAffiliateName();
    case OFFER_TEXT:
      return isSetOfferText();
    case OFFER_IMAGE_URL:
      return isSetOfferImageUrl();
    case M_OFFER_TEXT:
      return isSetMOfferText();
    case M_OFFER_IMAGE_URL:
      return isSetMOfferImageUrl();
    case AFFILIATE_SKU:
      return isSetAffiliateSku();
    case AFFILIATE_URL:
      return isSetAffiliateUrl();
    case ACTIVE:
      return isSetActive();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_itemId = true;
    boolean that_present_itemId = true;
    if (this_present_itemId || that_present_itemId) {
      if (!(this_present_itemId && that_present_itemId))
        return false;
      if (this.itemId != that.itemId)
        return false;
    }

    boolean this_present_affiliateId = true;
    boolean that_present_affiliateId = true;
    if (this_present_affiliateId || that_present_affiliateId) {
      if (!(this_present_affiliateId && that_present_affiliateId))
        return false;
      if (this.affiliateId != that.affiliateId)
        return false;
    }

    boolean this_present_affiliateName = true && this.isSetAffiliateName();
    boolean that_present_affiliateName = true && that.isSetAffiliateName();
    if (this_present_affiliateName || that_present_affiliateName) {
      if (!(this_present_affiliateName && that_present_affiliateName))
        return false;
      if (!this.affiliateName.equals(that.affiliateName))
        return false;
    }

    boolean this_present_offerText = true && this.isSetOfferText();
    boolean that_present_offerText = true && that.isSetOfferText();
    if (this_present_offerText || that_present_offerText) {
      if (!(this_present_offerText && that_present_offerText))
        return false;
      if (!this.offerText.equals(that.offerText))
        return false;
    }

    boolean this_present_offerImageUrl = true && this.isSetOfferImageUrl();
    boolean that_present_offerImageUrl = true && that.isSetOfferImageUrl();
    if (this_present_offerImageUrl || that_present_offerImageUrl) {
      if (!(this_present_offerImageUrl && that_present_offerImageUrl))
        return false;
      if (!this.offerImageUrl.equals(that.offerImageUrl))
        return false;
    }

    boolean this_present_mOfferText = true && this.isSetMOfferText();
    boolean that_present_mOfferText = true && that.isSetMOfferText();
    if (this_present_mOfferText || that_present_mOfferText) {
      if (!(this_present_mOfferText && that_present_mOfferText))
        return false;
      if (!this.mOfferText.equals(that.mOfferText))
        return false;
    }

    boolean this_present_mOfferImageUrl = true && this.isSetMOfferImageUrl();
    boolean that_present_mOfferImageUrl = true && that.isSetMOfferImageUrl();
    if (this_present_mOfferImageUrl || that_present_mOfferImageUrl) {
      if (!(this_present_mOfferImageUrl && that_present_mOfferImageUrl))
        return false;
      if (!this.mOfferImageUrl.equals(that.mOfferImageUrl))
        return false;
    }

    boolean this_present_affiliateSku = true && this.isSetAffiliateSku();
    boolean that_present_affiliateSku = true && that.isSetAffiliateSku();
    if (this_present_affiliateSku || that_present_affiliateSku) {
      if (!(this_present_affiliateSku && that_present_affiliateSku))
        return false;
      if (!this.affiliateSku.equals(that.affiliateSku))
        return false;
    }

    boolean this_present_affiliateUrl = true && this.isSetAffiliateUrl();
    boolean that_present_affiliateUrl = true && that.isSetAffiliateUrl();
    if (this_present_affiliateUrl || that_present_affiliateUrl) {
      if (!(this_present_affiliateUrl && that_present_affiliateUrl))
        return false;
      if (!this.affiliateUrl.equals(that.affiliateUrl))
        return false;
    }

    boolean this_present_active = true;
    boolean that_present_active = true;
    if (this_present_active || that_present_active) {
      if (!(this_present_active && that_present_active))
        return false;
      if (this.active != that.active)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetItemId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(typedOther.isSetAffiliateId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAffiliateId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateId, typedOther.affiliateId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAffiliateName()).compareTo(typedOther.isSetAffiliateName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAffiliateName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateName, typedOther.affiliateName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOfferText()).compareTo(typedOther.isSetOfferText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOfferText()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offerText, typedOther.offerText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOfferImageUrl()).compareTo(typedOther.isSetOfferImageUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOfferImageUrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offerImageUrl, typedOther.offerImageUrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMOfferText()).compareTo(typedOther.isSetMOfferText());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMOfferText()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mOfferText, typedOther.mOfferText);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMOfferImageUrl()).compareTo(typedOther.isSetMOfferImageUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMOfferImageUrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mOfferImageUrl, typedOther.mOfferImageUrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAffiliateSku()).compareTo(typedOther.isSetAffiliateSku());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAffiliateSku()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateSku, typedOther.affiliateSku);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAffiliateUrl()).compareTo(typedOther.isSetAffiliateUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAffiliateUrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateUrl, typedOther.affiliateUrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetActive()).compareTo(typedOther.isSetActive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActive()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.active, typedOther.active);
      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.itemId = iprot.readI64();
            setItemIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // AFFILIATE_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.affiliateId = iprot.readI64();
            setAffiliateIdIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // AFFILIATE_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.affiliateName = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // OFFER_TEXT
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.offerText = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // OFFER_IMAGE_URL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.offerImageUrl = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // M_OFFER_TEXT
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.mOfferText = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // M_OFFER_IMAGE_URL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.mOfferImageUrl = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 8: // AFFILIATE_SKU
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.affiliateSku = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 9: // AFFILIATE_URL
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.affiliateUrl = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 10: // ACTIVE
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.active = iprot.readBool();
            setActiveIsSet(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.itemId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
    oprot.writeI64(this.affiliateId);
    oprot.writeFieldEnd();
    if (this.affiliateName != null) {
      oprot.writeFieldBegin(AFFILIATE_NAME_FIELD_DESC);
      oprot.writeString(this.affiliateName);
      oprot.writeFieldEnd();
    }
    if (this.offerText != null) {
      oprot.writeFieldBegin(OFFER_TEXT_FIELD_DESC);
      oprot.writeString(this.offerText);
      oprot.writeFieldEnd();
    }
    if (this.offerImageUrl != null) {
      oprot.writeFieldBegin(OFFER_IMAGE_URL_FIELD_DESC);
      oprot.writeString(this.offerImageUrl);
      oprot.writeFieldEnd();
    }
    if (this.mOfferText != null) {
      oprot.writeFieldBegin(M_OFFER_TEXT_FIELD_DESC);
      oprot.writeString(this.mOfferText);
      oprot.writeFieldEnd();
    }
    if (this.mOfferImageUrl != null) {
      oprot.writeFieldBegin(M_OFFER_IMAGE_URL_FIELD_DESC);
      oprot.writeString(this.mOfferImageUrl);
      oprot.writeFieldEnd();
    }
    if (this.affiliateSku != null) {
      oprot.writeFieldBegin(AFFILIATE_SKU_FIELD_DESC);
      oprot.writeString(this.affiliateSku);
      oprot.writeFieldEnd();
    }
    if (this.affiliateUrl != null) {
      oprot.writeFieldBegin(AFFILIATE_URL_FIELD_DESC);
      oprot.writeString(this.affiliateUrl);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(ACTIVE_FIELD_DESC);
    oprot.writeBool(this.active);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("itemId:");
    sb.append(this.itemId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("affiliateId:");
    sb.append(this.affiliateId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("affiliateName:");
    if (this.affiliateName == null) {
      sb.append("null");
    } else {
      sb.append(this.affiliateName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("offerText:");
    if (this.offerText == null) {
      sb.append("null");
    } else {
      sb.append(this.offerText);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("offerImageUrl:");
    if (this.offerImageUrl == null) {
      sb.append("null");
    } else {
      sb.append(this.offerImageUrl);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("mOfferText:");
    if (this.mOfferText == null) {
      sb.append("null");
    } else {
      sb.append(this.mOfferText);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("mOfferImageUrl:");
    if (this.mOfferImageUrl == null) {
      sb.append("null");
    } else {
      sb.append(this.mOfferImageUrl);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("affiliateSku:");
    if (this.affiliateSku == null) {
      sb.append("null");
    } else {
      sb.append(this.affiliateSku);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("affiliateUrl:");
    if (this.affiliateUrl == null) {
      sb.append("null");
    } else {
      sb.append(this.affiliateUrl);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("active:");
    sb.append(this.active);
    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);
    }
  }

}