All Downloads are FREE. Search and download functionalities are using the official Maven repository.

open_rtb.SiteThrift Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package open_rtb;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
 * 3.3.5 Site Object
 * A site object should be included if the ad supported content is part of a website (as opposed to an application). A bid request must not contain both a site object and an app object.
 * The site object itself and all of its parameters are optional, so default values are not provided. If an optional parameter is not specified, it should be considered unknown. At a minimum, it’s useful to provide a page URL or a site ID, but this is not strictly required.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class SiteThrift implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SiteThrift");

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CAT_FIELD_DESC = new org.apache.thrift.protocol.TField("cat", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField SECTIONCAT_FIELD_DESC = new org.apache.thrift.protocol.TField("sectioncat", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField PAGECAT_FIELD_DESC = new org.apache.thrift.protocol.TField("pagecat", org.apache.thrift.protocol.TType.LIST, (short)6);
  private static final org.apache.thrift.protocol.TField PAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("page", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField PRIVACYPOLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("privacypolicy", org.apache.thrift.protocol.TType.BYTE, (short)8);
  private static final org.apache.thrift.protocol.TField REF_FIELD_DESC = new org.apache.thrift.protocol.TField("ref", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField SEARCH_FIELD_DESC = new org.apache.thrift.protocol.TField("search", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField PUBLISHER_FIELD_DESC = new org.apache.thrift.protocol.TField("publisher", org.apache.thrift.protocol.TType.STRUCT, (short)11);
  private static final org.apache.thrift.protocol.TField CONTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("content", org.apache.thrift.protocol.TType.STRUCT, (short)12);
  private static final org.apache.thrift.protocol.TField KEYWORDS_FIELD_DESC = new org.apache.thrift.protocol.TField("keywords", org.apache.thrift.protocol.TType.STRING, (short)13);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new SiteThriftStandardSchemeFactory());
    schemes.put(TupleScheme.class, new SiteThriftTupleSchemeFactory());
  }

  /**
   * Site ID on the exchange.
   */
  public String id; // optional
  /**
   * Site name (may be masked at publisher’s request).
   */
  public String name; // optional
  /**
   * Domain of the site, used for advertiser side blocking. For example, “foo.com”.
   */
  public String domain; // optional
  /**
   * Array of IAB content categories for the overall site. See Table 6.1 Content Categories.
   */
  public List cat; // optional
  /**
   * Array of IAB content categories for the current subsection of the site. See Table 6.1 Content Categories.
   */
  public List sectioncat; // optional
  /**
   * Array of IAB content categories for the current page. See Table 6.1 Content Categories.
   */
  public List pagecat; // optional
  /**
   * URL of the page where the impression will be shown.
   */
  public String page; // optional
  /**
   * Specifies whether the site has a privacy policy. “1” means there is a policy. “0” means there is not.
   */
  public byte privacypolicy; // optional
  /**
   * Referrer URL that caused navigation to the current page.
   */
  public String ref; // optional
  /**
   * Search string that caused navigation to the current page.
   */
  public String search; // optional
  /**
   * See Publisher Object.
   */
  public PublisherThrift publisher; // optional
  /**
   * See Content Object.
   */
  public ContentThrift content; // optional
  /**
   * List of keywords describing this site in a comma separated string.
   */
  public String keywords; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     * Site ID on the exchange.
     */
    ID((short)1, "id"),
    /**
     * Site name (may be masked at publisher’s request).
     */
    NAME((short)2, "name"),
    /**
     * Domain of the site, used for advertiser side blocking. For example, “foo.com”.
     */
    DOMAIN((short)3, "domain"),
    /**
     * Array of IAB content categories for the overall site. See Table 6.1 Content Categories.
     */
    CAT((short)4, "cat"),
    /**
     * Array of IAB content categories for the current subsection of the site. See Table 6.1 Content Categories.
     */
    SECTIONCAT((short)5, "sectioncat"),
    /**
     * Array of IAB content categories for the current page. See Table 6.1 Content Categories.
     */
    PAGECAT((short)6, "pagecat"),
    /**
     * URL of the page where the impression will be shown.
     */
    PAGE((short)7, "page"),
    /**
     * Specifies whether the site has a privacy policy. “1” means there is a policy. “0” means there is not.
     */
    PRIVACYPOLICY((short)8, "privacypolicy"),
    /**
     * Referrer URL that caused navigation to the current page.
     */
    REF((short)9, "ref"),
    /**
     * Search string that caused navigation to the current page.
     */
    SEARCH((short)10, "search"),
    /**
     * See Publisher Object.
     */
    PUBLISHER((short)11, "publisher"),
    /**
     * See Content Object.
     */
    CONTENT((short)12, "content"),
    /**
     * List of keywords describing this site in a comma separated string.
     */
    KEYWORDS((short)13, "keywords");

    private static final Map byName = new HashMap();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ID
          return ID;
        case 2: // NAME
          return NAME;
        case 3: // DOMAIN
          return DOMAIN;
        case 4: // CAT
          return CAT;
        case 5: // SECTIONCAT
          return SECTIONCAT;
        case 6: // PAGECAT
          return PAGECAT;
        case 7: // PAGE
          return PAGE;
        case 8: // PRIVACYPOLICY
          return PRIVACYPOLICY;
        case 9: // REF
          return REF;
        case 10: // SEARCH
          return SEARCH;
        case 11: // PUBLISHER
          return PUBLISHER;
        case 12: // CONTENT
          return CONTENT;
        case 13: // KEYWORDS
          return KEYWORDS;
        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 __PRIVACYPOLICY_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ID,_Fields.NAME,_Fields.DOMAIN,_Fields.CAT,_Fields.SECTIONCAT,_Fields.PAGECAT,_Fields.PAGE,_Fields.PRIVACYPOLICY,_Fields.REF,_Fields.SEARCH,_Fields.PUBLISHER,_Fields.CONTENT,_Fields.KEYWORDS};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CAT, new org.apache.thrift.meta_data.FieldMetaData("cat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SECTIONCAT, new org.apache.thrift.meta_data.FieldMetaData("sectioncat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.PAGECAT, new org.apache.thrift.meta_data.FieldMetaData("pagecat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.PAGE, new org.apache.thrift.meta_data.FieldMetaData("page", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PRIVACYPOLICY, new org.apache.thrift.meta_data.FieldMetaData("privacypolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
    tmpMap.put(_Fields.REF, new org.apache.thrift.meta_data.FieldMetaData("ref", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SEARCH, new org.apache.thrift.meta_data.FieldMetaData("search", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PUBLISHER, new org.apache.thrift.meta_data.FieldMetaData("publisher", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PublisherThrift.class)));
    tmpMap.put(_Fields.CONTENT, new org.apache.thrift.meta_data.FieldMetaData("content", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ContentThrift.class)));
    tmpMap.put(_Fields.KEYWORDS, new org.apache.thrift.meta_data.FieldMetaData("keywords", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SiteThrift.class, metaDataMap);
  }

  public SiteThrift() {
    this.id = "";

    this.name = "";

    this.domain = "";

    this.page = "";

    this.privacypolicy = (byte)0;

    this.ref = "";

    this.search = "";

    this.keywords = "";

  }

  /**
   * Performs a deep copy on other.
   */
  public SiteThrift(SiteThrift other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetDomain()) {
      this.domain = other.domain;
    }
    if (other.isSetCat()) {
      List __this__cat = new ArrayList(other.cat);
      this.cat = __this__cat;
    }
    if (other.isSetSectioncat()) {
      List __this__sectioncat = new ArrayList(other.sectioncat);
      this.sectioncat = __this__sectioncat;
    }
    if (other.isSetPagecat()) {
      List __this__pagecat = new ArrayList(other.pagecat);
      this.pagecat = __this__pagecat;
    }
    if (other.isSetPage()) {
      this.page = other.page;
    }
    this.privacypolicy = other.privacypolicy;
    if (other.isSetRef()) {
      this.ref = other.ref;
    }
    if (other.isSetSearch()) {
      this.search = other.search;
    }
    if (other.isSetPublisher()) {
      this.publisher = new PublisherThrift(other.publisher);
    }
    if (other.isSetContent()) {
      this.content = new ContentThrift(other.content);
    }
    if (other.isSetKeywords()) {
      this.keywords = other.keywords;
    }
  }

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

  @Override
  public void clear() {
    this.id = "";

    this.name = "";

    this.domain = "";

    this.cat = null;
    this.sectioncat = null;
    this.pagecat = null;
    this.page = "";

    this.privacypolicy = (byte)0;

    this.ref = "";

    this.search = "";

    this.publisher = null;
    this.content = null;
    this.keywords = "";

  }

  /**
   * Site ID on the exchange.
   */
  public String getId() {
    return this.id;
  }

  /**
   * Site ID on the exchange.
   */
  public SiteThrift setId(String id) {
    this.id = id;
    return this;
  }

  public void unsetId() {
    this.id = null;
  }

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

  public void setIdIsSet(boolean value) {
    if (!value) {
      this.id = null;
    }
  }

  /**
   * Site name (may be masked at publisher’s request).
   */
  public String getName() {
    return this.name;
  }

  /**
   * Site name (may be masked at publisher’s request).
   */
  public SiteThrift setName(String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  /**
   * Domain of the site, used for advertiser side blocking. For example, “foo.com”.
   */
  public String getDomain() {
    return this.domain;
  }

  /**
   * Domain of the site, used for advertiser side blocking. For example, “foo.com”.
   */
  public SiteThrift setDomain(String domain) {
    this.domain = domain;
    return this;
  }

  public void unsetDomain() {
    this.domain = null;
  }

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

  public void setDomainIsSet(boolean value) {
    if (!value) {
      this.domain = null;
    }
  }

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

  public java.util.Iterator getCatIterator() {
    return (this.cat == null) ? null : this.cat.iterator();
  }

  public void addToCat(String elem) {
    if (this.cat == null) {
      this.cat = new ArrayList();
    }
    this.cat.add(elem);
  }

  /**
   * Array of IAB content categories for the overall site. See Table 6.1 Content Categories.
   */
  public List getCat() {
    return this.cat;
  }

  /**
   * Array of IAB content categories for the overall site. See Table 6.1 Content Categories.
   */
  public SiteThrift setCat(List cat) {
    this.cat = cat;
    return this;
  }

  public void unsetCat() {
    this.cat = null;
  }

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

  public void setCatIsSet(boolean value) {
    if (!value) {
      this.cat = null;
    }
  }

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

  public java.util.Iterator getSectioncatIterator() {
    return (this.sectioncat == null) ? null : this.sectioncat.iterator();
  }

  public void addToSectioncat(String elem) {
    if (this.sectioncat == null) {
      this.sectioncat = new ArrayList();
    }
    this.sectioncat.add(elem);
  }

  /**
   * Array of IAB content categories for the current subsection of the site. See Table 6.1 Content Categories.
   */
  public List getSectioncat() {
    return this.sectioncat;
  }

  /**
   * Array of IAB content categories for the current subsection of the site. See Table 6.1 Content Categories.
   */
  public SiteThrift setSectioncat(List sectioncat) {
    this.sectioncat = sectioncat;
    return this;
  }

  public void unsetSectioncat() {
    this.sectioncat = null;
  }

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

  public void setSectioncatIsSet(boolean value) {
    if (!value) {
      this.sectioncat = null;
    }
  }

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

  public java.util.Iterator getPagecatIterator() {
    return (this.pagecat == null) ? null : this.pagecat.iterator();
  }

  public void addToPagecat(String elem) {
    if (this.pagecat == null) {
      this.pagecat = new ArrayList();
    }
    this.pagecat.add(elem);
  }

  /**
   * Array of IAB content categories for the current page. See Table 6.1 Content Categories.
   */
  public List getPagecat() {
    return this.pagecat;
  }

  /**
   * Array of IAB content categories for the current page. See Table 6.1 Content Categories.
   */
  public SiteThrift setPagecat(List pagecat) {
    this.pagecat = pagecat;
    return this;
  }

  public void unsetPagecat() {
    this.pagecat = null;
  }

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

  public void setPagecatIsSet(boolean value) {
    if (!value) {
      this.pagecat = null;
    }
  }

  /**
   * URL of the page where the impression will be shown.
   */
  public String getPage() {
    return this.page;
  }

  /**
   * URL of the page where the impression will be shown.
   */
  public SiteThrift setPage(String page) {
    this.page = page;
    return this;
  }

  public void unsetPage() {
    this.page = null;
  }

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

  public void setPageIsSet(boolean value) {
    if (!value) {
      this.page = null;
    }
  }

  /**
   * Specifies whether the site has a privacy policy. “1” means there is a policy. “0” means there is not.
   */
  public byte getPrivacypolicy() {
    return this.privacypolicy;
  }

  /**
   * Specifies whether the site has a privacy policy. “1” means there is a policy. “0” means there is not.
   */
  public SiteThrift setPrivacypolicy(byte privacypolicy) {
    this.privacypolicy = privacypolicy;
    setPrivacypolicyIsSet(true);
    return this;
  }

  public void unsetPrivacypolicy() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRIVACYPOLICY_ISSET_ID);
  }

  /** Returns true if field privacypolicy is set (has been assigned a value) and false otherwise */
  public boolean isSetPrivacypolicy() {
    return EncodingUtils.testBit(__isset_bitfield, __PRIVACYPOLICY_ISSET_ID);
  }

  public void setPrivacypolicyIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRIVACYPOLICY_ISSET_ID, value);
  }

  /**
   * Referrer URL that caused navigation to the current page.
   */
  public String getRef() {
    return this.ref;
  }

  /**
   * Referrer URL that caused navigation to the current page.
   */
  public SiteThrift setRef(String ref) {
    this.ref = ref;
    return this;
  }

  public void unsetRef() {
    this.ref = null;
  }

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

  public void setRefIsSet(boolean value) {
    if (!value) {
      this.ref = null;
    }
  }

  /**
   * Search string that caused navigation to the current page.
   */
  public String getSearch() {
    return this.search;
  }

  /**
   * Search string that caused navigation to the current page.
   */
  public SiteThrift setSearch(String search) {
    this.search = search;
    return this;
  }

  public void unsetSearch() {
    this.search = null;
  }

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

  public void setSearchIsSet(boolean value) {
    if (!value) {
      this.search = null;
    }
  }

  /**
   * See Publisher Object.
   */
  public PublisherThrift getPublisher() {
    return this.publisher;
  }

  /**
   * See Publisher Object.
   */
  public SiteThrift setPublisher(PublisherThrift publisher) {
    this.publisher = publisher;
    return this;
  }

  public void unsetPublisher() {
    this.publisher = null;
  }

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

  public void setPublisherIsSet(boolean value) {
    if (!value) {
      this.publisher = null;
    }
  }

  /**
   * See Content Object.
   */
  public ContentThrift getContent() {
    return this.content;
  }

  /**
   * See Content Object.
   */
  public SiteThrift setContent(ContentThrift content) {
    this.content = content;
    return this;
  }

  public void unsetContent() {
    this.content = null;
  }

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

  public void setContentIsSet(boolean value) {
    if (!value) {
      this.content = null;
    }
  }

  /**
   * List of keywords describing this site in a comma separated string.
   */
  public String getKeywords() {
    return this.keywords;
  }

  /**
   * List of keywords describing this site in a comma separated string.
   */
  public SiteThrift setKeywords(String keywords) {
    this.keywords = keywords;
    return this;
  }

  public void unsetKeywords() {
    this.keywords = null;
  }

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

  public void setKeywordsIsSet(boolean value) {
    if (!value) {
      this.keywords = null;
    }
  }

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

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((String)value);
      }
      break;

    case DOMAIN:
      if (value == null) {
        unsetDomain();
      } else {
        setDomain((String)value);
      }
      break;

    case CAT:
      if (value == null) {
        unsetCat();
      } else {
        setCat((List)value);
      }
      break;

    case SECTIONCAT:
      if (value == null) {
        unsetSectioncat();
      } else {
        setSectioncat((List)value);
      }
      break;

    case PAGECAT:
      if (value == null) {
        unsetPagecat();
      } else {
        setPagecat((List)value);
      }
      break;

    case PAGE:
      if (value == null) {
        unsetPage();
      } else {
        setPage((String)value);
      }
      break;

    case PRIVACYPOLICY:
      if (value == null) {
        unsetPrivacypolicy();
      } else {
        setPrivacypolicy((Byte)value);
      }
      break;

    case REF:
      if (value == null) {
        unsetRef();
      } else {
        setRef((String)value);
      }
      break;

    case SEARCH:
      if (value == null) {
        unsetSearch();
      } else {
        setSearch((String)value);
      }
      break;

    case PUBLISHER:
      if (value == null) {
        unsetPublisher();
      } else {
        setPublisher((PublisherThrift)value);
      }
      break;

    case CONTENT:
      if (value == null) {
        unsetContent();
      } else {
        setContent((ContentThrift)value);
      }
      break;

    case KEYWORDS:
      if (value == null) {
        unsetKeywords();
      } else {
        setKeywords((String)value);
      }
      break;

    }
  }

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

    case NAME:
      return getName();

    case DOMAIN:
      return getDomain();

    case CAT:
      return getCat();

    case SECTIONCAT:
      return getSectioncat();

    case PAGECAT:
      return getPagecat();

    case PAGE:
      return getPage();

    case PRIVACYPOLICY:
      return Byte.valueOf(getPrivacypolicy());

    case REF:
      return getRef();

    case SEARCH:
      return getSearch();

    case PUBLISHER:
      return getPublisher();

    case CONTENT:
      return getContent();

    case KEYWORDS:
      return getKeywords();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ID:
      return isSetId();
    case NAME:
      return isSetName();
    case DOMAIN:
      return isSetDomain();
    case CAT:
      return isSetCat();
    case SECTIONCAT:
      return isSetSectioncat();
    case PAGECAT:
      return isSetPagecat();
    case PAGE:
      return isSetPage();
    case PRIVACYPOLICY:
      return isSetPrivacypolicy();
    case REF:
      return isSetRef();
    case SEARCH:
      return isSetSearch();
    case PUBLISHER:
      return isSetPublisher();
    case CONTENT:
      return isSetContent();
    case KEYWORDS:
      return isSetKeywords();
    }
    throw new IllegalStateException();
  }

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

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

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

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_domain = true && this.isSetDomain();
    boolean that_present_domain = true && that.isSetDomain();
    if (this_present_domain || that_present_domain) {
      if (!(this_present_domain && that_present_domain))
        return false;
      if (!this.domain.equals(that.domain))
        return false;
    }

    boolean this_present_cat = true && this.isSetCat();
    boolean that_present_cat = true && that.isSetCat();
    if (this_present_cat || that_present_cat) {
      if (!(this_present_cat && that_present_cat))
        return false;
      if (!this.cat.equals(that.cat))
        return false;
    }

    boolean this_present_sectioncat = true && this.isSetSectioncat();
    boolean that_present_sectioncat = true && that.isSetSectioncat();
    if (this_present_sectioncat || that_present_sectioncat) {
      if (!(this_present_sectioncat && that_present_sectioncat))
        return false;
      if (!this.sectioncat.equals(that.sectioncat))
        return false;
    }

    boolean this_present_pagecat = true && this.isSetPagecat();
    boolean that_present_pagecat = true && that.isSetPagecat();
    if (this_present_pagecat || that_present_pagecat) {
      if (!(this_present_pagecat && that_present_pagecat))
        return false;
      if (!this.pagecat.equals(that.pagecat))
        return false;
    }

    boolean this_present_page = true && this.isSetPage();
    boolean that_present_page = true && that.isSetPage();
    if (this_present_page || that_present_page) {
      if (!(this_present_page && that_present_page))
        return false;
      if (!this.page.equals(that.page))
        return false;
    }

    boolean this_present_privacypolicy = true && this.isSetPrivacypolicy();
    boolean that_present_privacypolicy = true && that.isSetPrivacypolicy();
    if (this_present_privacypolicy || that_present_privacypolicy) {
      if (!(this_present_privacypolicy && that_present_privacypolicy))
        return false;
      if (this.privacypolicy != that.privacypolicy)
        return false;
    }

    boolean this_present_ref = true && this.isSetRef();
    boolean that_present_ref = true && that.isSetRef();
    if (this_present_ref || that_present_ref) {
      if (!(this_present_ref && that_present_ref))
        return false;
      if (!this.ref.equals(that.ref))
        return false;
    }

    boolean this_present_search = true && this.isSetSearch();
    boolean that_present_search = true && that.isSetSearch();
    if (this_present_search || that_present_search) {
      if (!(this_present_search && that_present_search))
        return false;
      if (!this.search.equals(that.search))
        return false;
    }

    boolean this_present_publisher = true && this.isSetPublisher();
    boolean that_present_publisher = true && that.isSetPublisher();
    if (this_present_publisher || that_present_publisher) {
      if (!(this_present_publisher && that_present_publisher))
        return false;
      if (!this.publisher.equals(that.publisher))
        return false;
    }

    boolean this_present_content = true && this.isSetContent();
    boolean that_present_content = true && that.isSetContent();
    if (this_present_content || that_present_content) {
      if (!(this_present_content && that_present_content))
        return false;
      if (!this.content.equals(that.content))
        return false;
    }

    boolean this_present_keywords = true && this.isSetKeywords();
    boolean that_present_keywords = true && that.isSetKeywords();
    if (this_present_keywords || that_present_keywords) {
      if (!(this_present_keywords && that_present_keywords))
        return false;
      if (!this.keywords.equals(that.keywords))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_id = true && (isSetId());
    list.add(present_id);
    if (present_id)
      list.add(id);

    boolean present_name = true && (isSetName());
    list.add(present_name);
    if (present_name)
      list.add(name);

    boolean present_domain = true && (isSetDomain());
    list.add(present_domain);
    if (present_domain)
      list.add(domain);

    boolean present_cat = true && (isSetCat());
    list.add(present_cat);
    if (present_cat)
      list.add(cat);

    boolean present_sectioncat = true && (isSetSectioncat());
    list.add(present_sectioncat);
    if (present_sectioncat)
      list.add(sectioncat);

    boolean present_pagecat = true && (isSetPagecat());
    list.add(present_pagecat);
    if (present_pagecat)
      list.add(pagecat);

    boolean present_page = true && (isSetPage());
    list.add(present_page);
    if (present_page)
      list.add(page);

    boolean present_privacypolicy = true && (isSetPrivacypolicy());
    list.add(present_privacypolicy);
    if (present_privacypolicy)
      list.add(privacypolicy);

    boolean present_ref = true && (isSetRef());
    list.add(present_ref);
    if (present_ref)
      list.add(ref);

    boolean present_search = true && (isSetSearch());
    list.add(present_search);
    if (present_search)
      list.add(search);

    boolean present_publisher = true && (isSetPublisher());
    list.add(present_publisher);
    if (present_publisher)
      list.add(publisher);

    boolean present_content = true && (isSetContent());
    list.add(present_content);
    if (present_content)
      list.add(content);

    boolean present_keywords = true && (isSetKeywords());
    list.add(present_keywords);
    if (present_keywords)
      list.add(keywords);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDomain()).compareTo(other.isSetDomain());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDomain()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCat()).compareTo(other.isSetCat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cat, other.cat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSectioncat()).compareTo(other.isSetSectioncat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSectioncat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sectioncat, other.sectioncat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPagecat()).compareTo(other.isSetPagecat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPagecat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pagecat, other.pagecat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPage()).compareTo(other.isSetPage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page, other.page);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPrivacypolicy()).compareTo(other.isSetPrivacypolicy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivacypolicy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privacypolicy, other.privacypolicy);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRef()).compareTo(other.isSetRef());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRef()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ref, other.ref);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSearch()).compareTo(other.isSetSearch());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSearch()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.search, other.search);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPublisher()).compareTo(other.isSetPublisher());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPublisher()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publisher, other.publisher);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContent()).compareTo(other.isSetContent());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContent()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.content, other.content);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetKeywords()).compareTo(other.isSetKeywords());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetKeywords()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keywords, other.keywords);
      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 {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

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

    if (isSetId()) {
      sb.append("id:");
      if (this.id == null) {
        sb.append("null");
      } else {
        sb.append(this.id);
      }
      first = false;
    }
    if (isSetName()) {
      if (!first) sb.append(", ");
      sb.append("name:");
      if (this.name == null) {
        sb.append("null");
      } else {
        sb.append(this.name);
      }
      first = false;
    }
    if (isSetDomain()) {
      if (!first) sb.append(", ");
      sb.append("domain:");
      if (this.domain == null) {
        sb.append("null");
      } else {
        sb.append(this.domain);
      }
      first = false;
    }
    if (isSetCat()) {
      if (!first) sb.append(", ");
      sb.append("cat:");
      if (this.cat == null) {
        sb.append("null");
      } else {
        sb.append(this.cat);
      }
      first = false;
    }
    if (isSetSectioncat()) {
      if (!first) sb.append(", ");
      sb.append("sectioncat:");
      if (this.sectioncat == null) {
        sb.append("null");
      } else {
        sb.append(this.sectioncat);
      }
      first = false;
    }
    if (isSetPagecat()) {
      if (!first) sb.append(", ");
      sb.append("pagecat:");
      if (this.pagecat == null) {
        sb.append("null");
      } else {
        sb.append(this.pagecat);
      }
      first = false;
    }
    if (isSetPage()) {
      if (!first) sb.append(", ");
      sb.append("page:");
      if (this.page == null) {
        sb.append("null");
      } else {
        sb.append(this.page);
      }
      first = false;
    }
    if (isSetPrivacypolicy()) {
      if (!first) sb.append(", ");
      sb.append("privacypolicy:");
      sb.append(this.privacypolicy);
      first = false;
    }
    if (isSetRef()) {
      if (!first) sb.append(", ");
      sb.append("ref:");
      if (this.ref == null) {
        sb.append("null");
      } else {
        sb.append(this.ref);
      }
      first = false;
    }
    if (isSetSearch()) {
      if (!first) sb.append(", ");
      sb.append("search:");
      if (this.search == null) {
        sb.append("null");
      } else {
        sb.append(this.search);
      }
      first = false;
    }
    if (isSetPublisher()) {
      if (!first) sb.append(", ");
      sb.append("publisher:");
      if (this.publisher == null) {
        sb.append("null");
      } else {
        sb.append(this.publisher);
      }
      first = false;
    }
    if (isSetContent()) {
      if (!first) sb.append(", ");
      sb.append("content:");
      if (this.content == null) {
        sb.append("null");
      } else {
        sb.append(this.content);
      }
      first = false;
    }
    if (isSetKeywords()) {
      if (!first) sb.append(", ");
      sb.append("keywords:");
      if (this.keywords == null) {
        sb.append("null");
      } else {
        sb.append(this.keywords);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (publisher != null) {
      publisher.validate();
    }
    if (content != null) {
      content.validate();
    }
  }

  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_bitfield = 0;
      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);
    }
  }

  private static class SiteThriftStandardSchemeFactory implements SchemeFactory {
    public SiteThriftStandardScheme getScheme() {
      return new SiteThriftStandardScheme();
    }
  }

  private static class SiteThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, SiteThrift struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.id = iprot.readString();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DOMAIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.domain = iprot.readString();
              struct.setDomainIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CAT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list160 = iprot.readListBegin();
                struct.cat = new ArrayList(_list160.size);
                String _elem161;
                for (int _i162 = 0; _i162 < _list160.size; ++_i162)
                {
                  _elem161 = iprot.readString();
                  struct.cat.add(_elem161);
                }
                iprot.readListEnd();
              }
              struct.setCatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SECTIONCAT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list163 = iprot.readListBegin();
                struct.sectioncat = new ArrayList(_list163.size);
                String _elem164;
                for (int _i165 = 0; _i165 < _list163.size; ++_i165)
                {
                  _elem164 = iprot.readString();
                  struct.sectioncat.add(_elem164);
                }
                iprot.readListEnd();
              }
              struct.setSectioncatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PAGECAT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list166 = iprot.readListBegin();
                struct.pagecat = new ArrayList(_list166.size);
                String _elem167;
                for (int _i168 = 0; _i168 < _list166.size; ++_i168)
                {
                  _elem167 = iprot.readString();
                  struct.pagecat.add(_elem167);
                }
                iprot.readListEnd();
              }
              struct.setPagecatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.page = iprot.readString();
              struct.setPageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // PRIVACYPOLICY
            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
              struct.privacypolicy = iprot.readByte();
              struct.setPrivacypolicyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // REF
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.ref = iprot.readString();
              struct.setRefIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // SEARCH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.search = iprot.readString();
              struct.setSearchIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // PUBLISHER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.publisher = new PublisherThrift();
              struct.publisher.read(iprot);
              struct.setPublisherIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // CONTENT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.content = new ContentThrift();
              struct.content.read(iprot);
              struct.setContentIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // KEYWORDS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.keywords = iprot.readString();
              struct.setKeywordsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.id != null) {
        if (struct.isSetId()) {
          oprot.writeFieldBegin(ID_FIELD_DESC);
          oprot.writeString(struct.id);
          oprot.writeFieldEnd();
        }
      }
      if (struct.name != null) {
        if (struct.isSetName()) {
          oprot.writeFieldBegin(NAME_FIELD_DESC);
          oprot.writeString(struct.name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.domain != null) {
        if (struct.isSetDomain()) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cat != null) {
        if (struct.isSetCat()) {
          oprot.writeFieldBegin(CAT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.cat.size()));
            for (String _iter169 : struct.cat)
            {
              oprot.writeString(_iter169);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.sectioncat != null) {
        if (struct.isSetSectioncat()) {
          oprot.writeFieldBegin(SECTIONCAT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sectioncat.size()));
            for (String _iter170 : struct.sectioncat)
            {
              oprot.writeString(_iter170);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.pagecat != null) {
        if (struct.isSetPagecat()) {
          oprot.writeFieldBegin(PAGECAT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.pagecat.size()));
            for (String _iter171 : struct.pagecat)
            {
              oprot.writeString(_iter171);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.page != null) {
        if (struct.isSetPage()) {
          oprot.writeFieldBegin(PAGE_FIELD_DESC);
          oprot.writeString(struct.page);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetPrivacypolicy()) {
        oprot.writeFieldBegin(PRIVACYPOLICY_FIELD_DESC);
        oprot.writeByte(struct.privacypolicy);
        oprot.writeFieldEnd();
      }
      if (struct.ref != null) {
        if (struct.isSetRef()) {
          oprot.writeFieldBegin(REF_FIELD_DESC);
          oprot.writeString(struct.ref);
          oprot.writeFieldEnd();
        }
      }
      if (struct.search != null) {
        if (struct.isSetSearch()) {
          oprot.writeFieldBegin(SEARCH_FIELD_DESC);
          oprot.writeString(struct.search);
          oprot.writeFieldEnd();
        }
      }
      if (struct.publisher != null) {
        if (struct.isSetPublisher()) {
          oprot.writeFieldBegin(PUBLISHER_FIELD_DESC);
          struct.publisher.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.content != null) {
        if (struct.isSetContent()) {
          oprot.writeFieldBegin(CONTENT_FIELD_DESC);
          struct.content.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.keywords != null) {
        if (struct.isSetKeywords()) {
          oprot.writeFieldBegin(KEYWORDS_FIELD_DESC);
          oprot.writeString(struct.keywords);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class SiteThriftTupleSchemeFactory implements SchemeFactory {
    public SiteThriftTupleScheme getScheme() {
      return new SiteThriftTupleScheme();
    }
  }

  private static class SiteThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, SiteThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetName()) {
        optionals.set(1);
      }
      if (struct.isSetDomain()) {
        optionals.set(2);
      }
      if (struct.isSetCat()) {
        optionals.set(3);
      }
      if (struct.isSetSectioncat()) {
        optionals.set(4);
      }
      if (struct.isSetPagecat()) {
        optionals.set(5);
      }
      if (struct.isSetPage()) {
        optionals.set(6);
      }
      if (struct.isSetPrivacypolicy()) {
        optionals.set(7);
      }
      if (struct.isSetRef()) {
        optionals.set(8);
      }
      if (struct.isSetSearch()) {
        optionals.set(9);
      }
      if (struct.isSetPublisher()) {
        optionals.set(10);
      }
      if (struct.isSetContent()) {
        optionals.set(11);
      }
      if (struct.isSetKeywords()) {
        optionals.set(12);
      }
      oprot.writeBitSet(optionals, 13);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetDomain()) {
        oprot.writeString(struct.domain);
      }
      if (struct.isSetCat()) {
        {
          oprot.writeI32(struct.cat.size());
          for (String _iter172 : struct.cat)
          {
            oprot.writeString(_iter172);
          }
        }
      }
      if (struct.isSetSectioncat()) {
        {
          oprot.writeI32(struct.sectioncat.size());
          for (String _iter173 : struct.sectioncat)
          {
            oprot.writeString(_iter173);
          }
        }
      }
      if (struct.isSetPagecat()) {
        {
          oprot.writeI32(struct.pagecat.size());
          for (String _iter174 : struct.pagecat)
          {
            oprot.writeString(_iter174);
          }
        }
      }
      if (struct.isSetPage()) {
        oprot.writeString(struct.page);
      }
      if (struct.isSetPrivacypolicy()) {
        oprot.writeByte(struct.privacypolicy);
      }
      if (struct.isSetRef()) {
        oprot.writeString(struct.ref);
      }
      if (struct.isSetSearch()) {
        oprot.writeString(struct.search);
      }
      if (struct.isSetPublisher()) {
        struct.publisher.write(oprot);
      }
      if (struct.isSetContent()) {
        struct.content.write(oprot);
      }
      if (struct.isSetKeywords()) {
        oprot.writeString(struct.keywords);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, SiteThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(13);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.domain = iprot.readString();
        struct.setDomainIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list175 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.cat = new ArrayList(_list175.size);
          String _elem176;
          for (int _i177 = 0; _i177 < _list175.size; ++_i177)
          {
            _elem176 = iprot.readString();
            struct.cat.add(_elem176);
          }
        }
        struct.setCatIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TList _list178 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.sectioncat = new ArrayList(_list178.size);
          String _elem179;
          for (int _i180 = 0; _i180 < _list178.size; ++_i180)
          {
            _elem179 = iprot.readString();
            struct.sectioncat.add(_elem179);
          }
        }
        struct.setSectioncatIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TList _list181 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.pagecat = new ArrayList(_list181.size);
          String _elem182;
          for (int _i183 = 0; _i183 < _list181.size; ++_i183)
          {
            _elem182 = iprot.readString();
            struct.pagecat.add(_elem182);
          }
        }
        struct.setPagecatIsSet(true);
      }
      if (incoming.get(6)) {
        struct.page = iprot.readString();
        struct.setPageIsSet(true);
      }
      if (incoming.get(7)) {
        struct.privacypolicy = iprot.readByte();
        struct.setPrivacypolicyIsSet(true);
      }
      if (incoming.get(8)) {
        struct.ref = iprot.readString();
        struct.setRefIsSet(true);
      }
      if (incoming.get(9)) {
        struct.search = iprot.readString();
        struct.setSearchIsSet(true);
      }
      if (incoming.get(10)) {
        struct.publisher = new PublisherThrift();
        struct.publisher.read(iprot);
        struct.setPublisherIsSet(true);
      }
      if (incoming.get(11)) {
        struct.content = new ContentThrift();
        struct.content.read(iprot);
        struct.setContentIsSet(true);
      }
      if (incoming.get(12)) {
        struct.keywords = iprot.readString();
        struct.setKeywordsIsSet(true);
      }
    }
  }

}