Subversion Repositories SmartDukaan

Rev

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

  private static final org.apache.thrift.protocol.TField BANNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("bannerName", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField LINK_FIELD_DESC = new org.apache.thrift.protocol.TField("link", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField HAS_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMap", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField PRIORITY_FIELD_DESC = new org.apache.thrift.protocol.TField("priority", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField BANNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bannerType", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField TARGET_FIELD_DESC = new org.apache.thrift.protocol.TField("target", org.apache.thrift.protocol.TType.BOOL, (short)7);

  private String bannerName; // required
  private String imageName; // required
  private String link; // required
  private boolean hasMap; // required
  private long priority; // required
  private BannerType bannerType; // required
  private boolean target; // 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 {
    BANNER_NAME((short)1, "bannerName"),
    IMAGE_NAME((short)2, "imageName"),
    LINK((short)3, "link"),
    HAS_MAP((short)4, "hasMap"),
    PRIORITY((short)5, "priority"),
    /**
     * 
     * @see BannerType
     */
    BANNER_TYPE((short)6, "bannerType"),
    TARGET((short)7, "target");

    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: // BANNER_NAME
          return BANNER_NAME;
        case 2: // IMAGE_NAME
          return IMAGE_NAME;
        case 3: // LINK
          return LINK;
        case 4: // HAS_MAP
          return HAS_MAP;
        case 5: // PRIORITY
          return PRIORITY;
        case 6: // BANNER_TYPE
          return BANNER_TYPE;
        case 7: // TARGET
          return TARGET;
        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 __HASMAP_ISSET_ID = 0;
  private static final int __PRIORITY_ISSET_ID = 1;
  private static final int __TARGET_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.BANNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("bannerName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LINK, new org.apache.thrift.meta_data.FieldMetaData("link", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.HAS_MAP, new org.apache.thrift.meta_data.FieldMetaData("hasMap", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PRIORITY, new org.apache.thrift.meta_data.FieldMetaData("priority", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.BANNER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bannerType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, BannerType.class)));
    tmpMap.put(_Fields.TARGET, new org.apache.thrift.meta_data.FieldMetaData("target", 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(Banner.class, metaDataMap);
  }

  public Banner() {
  }

  public Banner(
    String bannerName,
    String imageName,
    String link,
    boolean hasMap,
    long priority,
    BannerType bannerType,
    boolean target)
  {
    this();
    this.bannerName = bannerName;
    this.imageName = imageName;
    this.link = link;
    this.hasMap = hasMap;
    setHasMapIsSet(true);
    this.priority = priority;
    setPriorityIsSet(true);
    this.bannerType = bannerType;
    this.target = target;
    setTargetIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Banner(Banner other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    if (other.isSetBannerName()) {
      this.bannerName = other.bannerName;
    }
    if (other.isSetImageName()) {
      this.imageName = other.imageName;
    }
    if (other.isSetLink()) {
      this.link = other.link;
    }
    this.hasMap = other.hasMap;
    this.priority = other.priority;
    if (other.isSetBannerType()) {
      this.bannerType = other.bannerType;
    }
    this.target = other.target;
  }

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

  @Override
  public void clear() {
    this.bannerName = null;
    this.imageName = null;
    this.link = null;
    setHasMapIsSet(false);
    this.hasMap = false;
    setPriorityIsSet(false);
    this.priority = 0;
    this.bannerType = null;
    setTargetIsSet(false);
    this.target = false;
  }

  public String getBannerName() {
    return this.bannerName;
  }

  public void setBannerName(String bannerName) {
    this.bannerName = bannerName;
  }

  public void unsetBannerName() {
    this.bannerName = null;
  }

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

  public void setBannerNameIsSet(boolean value) {
    if (!value) {
      this.bannerName = null;
    }
  }

  public String getImageName() {
    return this.imageName;
  }

  public void setImageName(String imageName) {
    this.imageName = imageName;
  }

  public void unsetImageName() {
    this.imageName = null;
  }

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

  public void setImageNameIsSet(boolean value) {
    if (!value) {
      this.imageName = null;
    }
  }

  public String getLink() {
    return this.link;
  }

  public void setLink(String link) {
    this.link = link;
  }

  public void unsetLink() {
    this.link = null;
  }

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

  public void setLinkIsSet(boolean value) {
    if (!value) {
      this.link = null;
    }
  }

  public boolean isHasMap() {
    return this.hasMap;
  }

  public void setHasMap(boolean hasMap) {
    this.hasMap = hasMap;
    setHasMapIsSet(true);
  }

  public void unsetHasMap() {
    __isset_bit_vector.clear(__HASMAP_ISSET_ID);
  }

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

  public void setHasMapIsSet(boolean value) {
    __isset_bit_vector.set(__HASMAP_ISSET_ID, value);
  }

  public long getPriority() {
    return this.priority;
  }

  public void setPriority(long priority) {
    this.priority = priority;
    setPriorityIsSet(true);
  }

  public void unsetPriority() {
    __isset_bit_vector.clear(__PRIORITY_ISSET_ID);
  }

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

  public void setPriorityIsSet(boolean value) {
    __isset_bit_vector.set(__PRIORITY_ISSET_ID, value);
  }

  /**
   * 
   * @see BannerType
   */
  public BannerType getBannerType() {
    return this.bannerType;
  }

  /**
   * 
   * @see BannerType
   */
  public void setBannerType(BannerType bannerType) {
    this.bannerType = bannerType;
  }

  public void unsetBannerType() {
    this.bannerType = null;
  }

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

  public void setBannerTypeIsSet(boolean value) {
    if (!value) {
      this.bannerType = null;
    }
  }

  public boolean isTarget() {
    return this.target;
  }

  public void setTarget(boolean target) {
    this.target = target;
    setTargetIsSet(true);
  }

  public void unsetTarget() {
    __isset_bit_vector.clear(__TARGET_ISSET_ID);
  }

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

  public void setTargetIsSet(boolean value) {
    __isset_bit_vector.set(__TARGET_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case BANNER_NAME:
      if (value == null) {
        unsetBannerName();
      } else {
        setBannerName((String)value);
      }
      break;

    case IMAGE_NAME:
      if (value == null) {
        unsetImageName();
      } else {
        setImageName((String)value);
      }
      break;

    case LINK:
      if (value == null) {
        unsetLink();
      } else {
        setLink((String)value);
      }
      break;

    case HAS_MAP:
      if (value == null) {
        unsetHasMap();
      } else {
        setHasMap((Boolean)value);
      }
      break;

    case PRIORITY:
      if (value == null) {
        unsetPriority();
      } else {
        setPriority((Long)value);
      }
      break;

    case BANNER_TYPE:
      if (value == null) {
        unsetBannerType();
      } else {
        setBannerType((BannerType)value);
      }
      break;

    case TARGET:
      if (value == null) {
        unsetTarget();
      } else {
        setTarget((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case BANNER_NAME:
      return getBannerName();

    case IMAGE_NAME:
      return getImageName();

    case LINK:
      return getLink();

    case HAS_MAP:
      return Boolean.valueOf(isHasMap());

    case PRIORITY:
      return Long.valueOf(getPriority());

    case BANNER_TYPE:
      return getBannerType();

    case TARGET:
      return Boolean.valueOf(isTarget());

    }
    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 BANNER_NAME:
      return isSetBannerName();
    case IMAGE_NAME:
      return isSetImageName();
    case LINK:
      return isSetLink();
    case HAS_MAP:
      return isSetHasMap();
    case PRIORITY:
      return isSetPriority();
    case BANNER_TYPE:
      return isSetBannerType();
    case TARGET:
      return isSetTarget();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_bannerName = true && this.isSetBannerName();
    boolean that_present_bannerName = true && that.isSetBannerName();
    if (this_present_bannerName || that_present_bannerName) {
      if (!(this_present_bannerName && that_present_bannerName))
        return false;
      if (!this.bannerName.equals(that.bannerName))
        return false;
    }

    boolean this_present_imageName = true && this.isSetImageName();
    boolean that_present_imageName = true && that.isSetImageName();
    if (this_present_imageName || that_present_imageName) {
      if (!(this_present_imageName && that_present_imageName))
        return false;
      if (!this.imageName.equals(that.imageName))
        return false;
    }

    boolean this_present_link = true && this.isSetLink();
    boolean that_present_link = true && that.isSetLink();
    if (this_present_link || that_present_link) {
      if (!(this_present_link && that_present_link))
        return false;
      if (!this.link.equals(that.link))
        return false;
    }

    boolean this_present_hasMap = true;
    boolean that_present_hasMap = true;
    if (this_present_hasMap || that_present_hasMap) {
      if (!(this_present_hasMap && that_present_hasMap))
        return false;
      if (this.hasMap != that.hasMap)
        return false;
    }

    boolean this_present_priority = true;
    boolean that_present_priority = true;
    if (this_present_priority || that_present_priority) {
      if (!(this_present_priority && that_present_priority))
        return false;
      if (this.priority != that.priority)
        return false;
    }

    boolean this_present_bannerType = true && this.isSetBannerType();
    boolean that_present_bannerType = true && that.isSetBannerType();
    if (this_present_bannerType || that_present_bannerType) {
      if (!(this_present_bannerType && that_present_bannerType))
        return false;
      if (!this.bannerType.equals(that.bannerType))
        return false;
    }

    boolean this_present_target = true;
    boolean that_present_target = true;
    if (this_present_target || that_present_target) {
      if (!(this_present_target && that_present_target))
        return false;
      if (this.target != that.target)
        return false;
    }

    return true;
  }

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

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

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

    lastComparison = Boolean.valueOf(isSetBannerName()).compareTo(typedOther.isSetBannerName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBannerName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bannerName, typedOther.bannerName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetImageName()).compareTo(typedOther.isSetImageName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetImageName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, typedOther.imageName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLink()).compareTo(typedOther.isSetLink());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLink()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.link, typedOther.link);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHasMap()).compareTo(typedOther.isSetHasMap());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHasMap()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMap, typedOther.hasMap);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPriority()).compareTo(typedOther.isSetPriority());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPriority()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.priority, typedOther.priority);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBannerType()).compareTo(typedOther.isSetBannerType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBannerType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bannerType, typedOther.bannerType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTarget()).compareTo(typedOther.isSetTarget());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTarget()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.target, typedOther.target);
      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: // BANNER_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.bannerName = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // IMAGE_NAME
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.imageName = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // LINK
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.link = iprot.readString();
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // HAS_MAP
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.hasMap = iprot.readBool();
            setHasMapIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 5: // PRIORITY
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.priority = iprot.readI64();
            setPriorityIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 6: // BANNER_TYPE
          if (field.type == org.apache.thrift.protocol.TType.I32) {
            this.bannerType = BannerType.findByValue(iprot.readI32());
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 7: // TARGET
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
            this.target = iprot.readBool();
            setTargetIsSet(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.bannerName != null) {
      oprot.writeFieldBegin(BANNER_NAME_FIELD_DESC);
      oprot.writeString(this.bannerName);
      oprot.writeFieldEnd();
    }
    if (this.imageName != null) {
      oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC);
      oprot.writeString(this.imageName);
      oprot.writeFieldEnd();
    }
    if (this.link != null) {
      oprot.writeFieldBegin(LINK_FIELD_DESC);
      oprot.writeString(this.link);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(HAS_MAP_FIELD_DESC);
    oprot.writeBool(this.hasMap);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PRIORITY_FIELD_DESC);
    oprot.writeI64(this.priority);
    oprot.writeFieldEnd();
    if (this.bannerType != null) {
      oprot.writeFieldBegin(BANNER_TYPE_FIELD_DESC);
      oprot.writeI32(this.bannerType.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(TARGET_FIELD_DESC);
    oprot.writeBool(this.target);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("bannerName:");
    if (this.bannerName == null) {
      sb.append("null");
    } else {
      sb.append(this.bannerName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("imageName:");
    if (this.imageName == null) {
      sb.append("null");
    } else {
      sb.append(this.imageName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("link:");
    if (this.link == null) {
      sb.append("null");
    } else {
      sb.append(this.link);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hasMap:");
    sb.append(this.hasMap);
    first = false;
    if (!first) sb.append(", ");
    sb.append("priority:");
    sb.append(this.priority);
    first = false;
    if (!first) sb.append(", ");
    sb.append("bannerType:");
    if (this.bannerType == null) {
      sb.append("null");
    } else {
      sb.append(this.bannerType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("target:");
    sb.append(this.target);
    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);
    }
  }

}