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

tech.aroma.thrift.Application Maven / Gradle / Ivy

Go to download

Part of the Aroma Project. This project contains the Service and Model Definitions. From this the Server and Client interfaces are generated for the Aroma Service.

There is a newer version: 2.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package tech.aroma.thrift;

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"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-10")
public class Application 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("Application");

  private static final org.apache.thrift.protocol.TField OWNERS_FIELD_DESC = new org.apache.thrift.protocol.TField("owners", org.apache.thrift.protocol.TType.SET, (short)1);
  private static final org.apache.thrift.protocol.TField TIME_OF_PROVISIONING_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfProvisioning", org.apache.thrift.protocol.TType.I64, (short)2);
  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)3);
  private static final org.apache.thrift.protocol.TField APPLICATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationId", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField TOTAL_MESSAGES_SENT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalMessagesSent", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField ICON_FIELD_DESC = new org.apache.thrift.protocol.TField("icon", org.apache.thrift.protocol.TType.STRUCT, (short)6);
  private static final org.apache.thrift.protocol.TField PROGRAMMING_LANGUAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("programmingLanguage", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField FOLLOWERS_FIELD_DESC = new org.apache.thrift.protocol.TField("followers", org.apache.thrift.protocol.TType.SET, (short)8);
  private static final org.apache.thrift.protocol.TField APPLICATION_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationDescription", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField ORGANIZATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("organizationId", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField TIER_FIELD_DESC = new org.apache.thrift.protocol.TField("tier", org.apache.thrift.protocol.TType.I32, (short)11);
  private static final org.apache.thrift.protocol.TField TIME_OF_TOKEN_EXPIRATION_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfTokenExpiration", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField APPLICATION_ICON_MEDIA_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationIconMediaId", org.apache.thrift.protocol.TType.STRING, (short)13);
  private static final org.apache.thrift.protocol.TField IS_FOLLOWING_FIELD_DESC = new org.apache.thrift.protocol.TField("isFollowing", org.apache.thrift.protocol.TType.BOOL, (short)14);

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

  /**
   * Owners can perform administrative actions on a service.
   */
  public Set owners; // required
  /**
   * When the application was first provisioned.
   */
  public long timeOfProvisioning; // required
  /**
   * The name of the application.
   */
  public String name; // required
  /**
   * The Automatically generated ID for the Application.
   */
  public String applicationId; // required
  /**
   * The total amount of messages that
   * have been counted so far for the Application
   */
  public long totalMessagesSent; // required
  public Image icon; // optional
  /**
   * 
   * @see ProgrammingLanguage
   */
  public ProgrammingLanguage programmingLanguage; // optional
  /**
   * Defines the userIds of the people who are following this Application.
   */
  public Set followers; // optional
  public String applicationDescription; // required
  public String organizationId; // required
  /**
   * 
   * @see Tier
   */
  public Tier tier; // optional
  /**
   * The time the App's token will expire.
   */
  public long timeOfTokenExpiration; // required
  public String applicationIconMediaId; // optional
  /**
   * Set to true if the calling user follows this Application.
   */
  public boolean isFollowing; // 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 {
    /**
     * Owners can perform administrative actions on a service.
     */
    OWNERS((short)1, "owners"),
    /**
     * When the application was first provisioned.
     */
    TIME_OF_PROVISIONING((short)2, "timeOfProvisioning"),
    /**
     * The name of the application.
     */
    NAME((short)3, "name"),
    /**
     * The Automatically generated ID for the Application.
     */
    APPLICATION_ID((short)4, "applicationId"),
    /**
     * The total amount of messages that
     * have been counted so far for the Application
     */
    TOTAL_MESSAGES_SENT((short)5, "totalMessagesSent"),
    ICON((short)6, "icon"),
    /**
     * 
     * @see ProgrammingLanguage
     */
    PROGRAMMING_LANGUAGE((short)7, "programmingLanguage"),
    /**
     * Defines the userIds of the people who are following this Application.
     */
    FOLLOWERS((short)8, "followers"),
    APPLICATION_DESCRIPTION((short)9, "applicationDescription"),
    ORGANIZATION_ID((short)10, "organizationId"),
    /**
     * 
     * @see Tier
     */
    TIER((short)11, "tier"),
    /**
     * The time the App's token will expire.
     */
    TIME_OF_TOKEN_EXPIRATION((short)12, "timeOfTokenExpiration"),
    APPLICATION_ICON_MEDIA_ID((short)13, "applicationIconMediaId"),
    /**
     * Set to true if the calling user follows this Application.
     */
    IS_FOLLOWING((short)14, "isFollowing");

    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: // OWNERS
          return OWNERS;
        case 2: // TIME_OF_PROVISIONING
          return TIME_OF_PROVISIONING;
        case 3: // NAME
          return NAME;
        case 4: // APPLICATION_ID
          return APPLICATION_ID;
        case 5: // TOTAL_MESSAGES_SENT
          return TOTAL_MESSAGES_SENT;
        case 6: // ICON
          return ICON;
        case 7: // PROGRAMMING_LANGUAGE
          return PROGRAMMING_LANGUAGE;
        case 8: // FOLLOWERS
          return FOLLOWERS;
        case 9: // APPLICATION_DESCRIPTION
          return APPLICATION_DESCRIPTION;
        case 10: // ORGANIZATION_ID
          return ORGANIZATION_ID;
        case 11: // TIER
          return TIER;
        case 12: // TIME_OF_TOKEN_EXPIRATION
          return TIME_OF_TOKEN_EXPIRATION;
        case 13: // APPLICATION_ICON_MEDIA_ID
          return APPLICATION_ICON_MEDIA_ID;
        case 14: // IS_FOLLOWING
          return IS_FOLLOWING;
        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 __TIMEOFPROVISIONING_ISSET_ID = 0;
  private static final int __TOTALMESSAGESSENT_ISSET_ID = 1;
  private static final int __TIMEOFTOKENEXPIRATION_ISSET_ID = 2;
  private static final int __ISFOLLOWING_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ICON,_Fields.PROGRAMMING_LANGUAGE,_Fields.FOLLOWERS,_Fields.TIER,_Fields.APPLICATION_ICON_MEDIA_ID,_Fields.IS_FOLLOWING};
  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.OWNERS, new org.apache.thrift.meta_data.FieldMetaData("owners", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , "uuid"))));
    tmpMap.put(_Fields.TIME_OF_PROVISIONING, new org.apache.thrift.meta_data.FieldMetaData("timeOfProvisioning", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "timestamp")));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.APPLICATION_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "uuid")));
    tmpMap.put(_Fields.TOTAL_MESSAGES_SENT, new org.apache.thrift.meta_data.FieldMetaData("totalMessagesSent", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "long")));
    tmpMap.put(_Fields.ICON, new org.apache.thrift.meta_data.FieldMetaData("icon", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Image.class)));
    tmpMap.put(_Fields.PROGRAMMING_LANGUAGE, new org.apache.thrift.meta_data.FieldMetaData("programmingLanguage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ProgrammingLanguage.class)));
    tmpMap.put(_Fields.FOLLOWERS, new org.apache.thrift.meta_data.FieldMetaData("followers", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , "uuid"))));
    tmpMap.put(_Fields.APPLICATION_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("applicationDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ORGANIZATION_ID, new org.apache.thrift.meta_data.FieldMetaData("organizationId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "uuid")));
    tmpMap.put(_Fields.TIER, new org.apache.thrift.meta_data.FieldMetaData("tier", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Tier.class)));
    tmpMap.put(_Fields.TIME_OF_TOKEN_EXPIRATION, new org.apache.thrift.meta_data.FieldMetaData("timeOfTokenExpiration", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "timestamp")));
    tmpMap.put(_Fields.APPLICATION_ICON_MEDIA_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationIconMediaId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "uuid")));
    tmpMap.put(_Fields.IS_FOLLOWING, new org.apache.thrift.meta_data.FieldMetaData("isFollowing", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Application.class, metaDataMap);
  }

  public Application() {
    this.followers = new HashSet();

    this.tier = tech.aroma.thrift.Tier.FREE;

  }

  public Application(
    Set owners,
    long timeOfProvisioning,
    String name,
    String applicationId,
    long totalMessagesSent,
    String applicationDescription,
    String organizationId,
    long timeOfTokenExpiration)
  {
    this();
    this.owners = owners;
    this.timeOfProvisioning = timeOfProvisioning;
    setTimeOfProvisioningIsSet(true);
    this.name = name;
    this.applicationId = applicationId;
    this.totalMessagesSent = totalMessagesSent;
    setTotalMessagesSentIsSet(true);
    this.applicationDescription = applicationDescription;
    this.organizationId = organizationId;
    this.timeOfTokenExpiration = timeOfTokenExpiration;
    setTimeOfTokenExpirationIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public Application(Application other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetOwners()) {
      Set __this__owners = new HashSet(other.owners.size());
      for (String other_element : other.owners) {
        __this__owners.add(other_element);
      }
      this.owners = __this__owners;
    }
    this.timeOfProvisioning = other.timeOfProvisioning;
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetApplicationId()) {
      this.applicationId = other.applicationId;
    }
    this.totalMessagesSent = other.totalMessagesSent;
    if (other.isSetIcon()) {
      this.icon = new Image(other.icon);
    }
    if (other.isSetProgrammingLanguage()) {
      this.programmingLanguage = other.programmingLanguage;
    }
    if (other.isSetFollowers()) {
      Set __this__followers = new HashSet(other.followers.size());
      for (String other_element : other.followers) {
        __this__followers.add(other_element);
      }
      this.followers = __this__followers;
    }
    if (other.isSetApplicationDescription()) {
      this.applicationDescription = other.applicationDescription;
    }
    if (other.isSetOrganizationId()) {
      this.organizationId = other.organizationId;
    }
    if (other.isSetTier()) {
      this.tier = other.tier;
    }
    this.timeOfTokenExpiration = other.timeOfTokenExpiration;
    if (other.isSetApplicationIconMediaId()) {
      this.applicationIconMediaId = other.applicationIconMediaId;
    }
    this.isFollowing = other.isFollowing;
  }

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

  @Override
  public void clear() {
    this.owners = null;
    setTimeOfProvisioningIsSet(false);
    this.timeOfProvisioning = 0;
    this.name = null;
    this.applicationId = null;
    setTotalMessagesSentIsSet(false);
    this.totalMessagesSent = 0;
    this.icon = null;
    this.programmingLanguage = null;
    this.followers = new HashSet();

    this.applicationDescription = null;
    this.organizationId = null;
    this.tier = tech.aroma.thrift.Tier.FREE;

    setTimeOfTokenExpirationIsSet(false);
    this.timeOfTokenExpiration = 0;
    this.applicationIconMediaId = null;
    setIsFollowingIsSet(false);
    this.isFollowing = false;
  }

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

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

  public void addToOwners(String elem) {
    if (this.owners == null) {
      this.owners = new HashSet();
    }
    this.owners.add(elem);
  }

  /**
   * Owners can perform administrative actions on a service.
   */
  public Set getOwners() {
    return this.owners;
  }

  /**
   * Owners can perform administrative actions on a service.
   */
  public Application setOwners(Set owners) {
    this.owners = owners;
    return this;
  }

  public void unsetOwners() {
    this.owners = null;
  }

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

  public void setOwnersIsSet(boolean value) {
    if (!value) {
      this.owners = null;
    }
  }

  /**
   * When the application was first provisioned.
   */
  public long getTimeOfProvisioning() {
    return this.timeOfProvisioning;
  }

  /**
   * When the application was first provisioned.
   */
  public Application setTimeOfProvisioning(long timeOfProvisioning) {
    this.timeOfProvisioning = timeOfProvisioning;
    setTimeOfProvisioningIsSet(true);
    return this;
  }

  public void unsetTimeOfProvisioning() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFPROVISIONING_ISSET_ID);
  }

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

  public void setTimeOfProvisioningIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFPROVISIONING_ISSET_ID, value);
  }

  /**
   * The name of the application.
   */
  public String getName() {
    return this.name;
  }

  /**
   * The name of the application.
   */
  public Application 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;
    }
  }

  /**
   * The Automatically generated ID for the Application.
   */
  public String getApplicationId() {
    return this.applicationId;
  }

  /**
   * The Automatically generated ID for the Application.
   */
  public Application setApplicationId(String applicationId) {
    this.applicationId = applicationId;
    return this;
  }

  public void unsetApplicationId() {
    this.applicationId = null;
  }

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

  public void setApplicationIdIsSet(boolean value) {
    if (!value) {
      this.applicationId = null;
    }
  }

  /**
   * The total amount of messages that
   * have been counted so far for the Application
   */
  public long getTotalMessagesSent() {
    return this.totalMessagesSent;
  }

  /**
   * The total amount of messages that
   * have been counted so far for the Application
   */
  public Application setTotalMessagesSent(long totalMessagesSent) {
    this.totalMessagesSent = totalMessagesSent;
    setTotalMessagesSentIsSet(true);
    return this;
  }

  public void unsetTotalMessagesSent() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALMESSAGESSENT_ISSET_ID);
  }

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

  public void setTotalMessagesSentIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALMESSAGESSENT_ISSET_ID, value);
  }

  public Image getIcon() {
    return this.icon;
  }

  public Application setIcon(Image icon) {
    this.icon = icon;
    return this;
  }

  public void unsetIcon() {
    this.icon = null;
  }

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

  public void setIconIsSet(boolean value) {
    if (!value) {
      this.icon = null;
    }
  }

  /**
   * 
   * @see ProgrammingLanguage
   */
  public ProgrammingLanguage getProgrammingLanguage() {
    return this.programmingLanguage;
  }

  /**
   * 
   * @see ProgrammingLanguage
   */
  public Application setProgrammingLanguage(ProgrammingLanguage programmingLanguage) {
    this.programmingLanguage = programmingLanguage;
    return this;
  }

  public void unsetProgrammingLanguage() {
    this.programmingLanguage = null;
  }

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

  public void setProgrammingLanguageIsSet(boolean value) {
    if (!value) {
      this.programmingLanguage = null;
    }
  }

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

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

  public void addToFollowers(String elem) {
    if (this.followers == null) {
      this.followers = new HashSet();
    }
    this.followers.add(elem);
  }

  /**
   * Defines the userIds of the people who are following this Application.
   */
  public Set getFollowers() {
    return this.followers;
  }

  /**
   * Defines the userIds of the people who are following this Application.
   */
  public Application setFollowers(Set followers) {
    this.followers = followers;
    return this;
  }

  public void unsetFollowers() {
    this.followers = null;
  }

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

  public void setFollowersIsSet(boolean value) {
    if (!value) {
      this.followers = null;
    }
  }

  public String getApplicationDescription() {
    return this.applicationDescription;
  }

  public Application setApplicationDescription(String applicationDescription) {
    this.applicationDescription = applicationDescription;
    return this;
  }

  public void unsetApplicationDescription() {
    this.applicationDescription = null;
  }

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

  public void setApplicationDescriptionIsSet(boolean value) {
    if (!value) {
      this.applicationDescription = null;
    }
  }

  public String getOrganizationId() {
    return this.organizationId;
  }

  public Application setOrganizationId(String organizationId) {
    this.organizationId = organizationId;
    return this;
  }

  public void unsetOrganizationId() {
    this.organizationId = null;
  }

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

  public void setOrganizationIdIsSet(boolean value) {
    if (!value) {
      this.organizationId = null;
    }
  }

  /**
   * 
   * @see Tier
   */
  public Tier getTier() {
    return this.tier;
  }

  /**
   * 
   * @see Tier
   */
  public Application setTier(Tier tier) {
    this.tier = tier;
    return this;
  }

  public void unsetTier() {
    this.tier = null;
  }

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

  public void setTierIsSet(boolean value) {
    if (!value) {
      this.tier = null;
    }
  }

  /**
   * The time the App's token will expire.
   */
  public long getTimeOfTokenExpiration() {
    return this.timeOfTokenExpiration;
  }

  /**
   * The time the App's token will expire.
   */
  public Application setTimeOfTokenExpiration(long timeOfTokenExpiration) {
    this.timeOfTokenExpiration = timeOfTokenExpiration;
    setTimeOfTokenExpirationIsSet(true);
    return this;
  }

  public void unsetTimeOfTokenExpiration() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFTOKENEXPIRATION_ISSET_ID);
  }

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

  public void setTimeOfTokenExpirationIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFTOKENEXPIRATION_ISSET_ID, value);
  }

  public String getApplicationIconMediaId() {
    return this.applicationIconMediaId;
  }

  public Application setApplicationIconMediaId(String applicationIconMediaId) {
    this.applicationIconMediaId = applicationIconMediaId;
    return this;
  }

  public void unsetApplicationIconMediaId() {
    this.applicationIconMediaId = null;
  }

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

  public void setApplicationIconMediaIdIsSet(boolean value) {
    if (!value) {
      this.applicationIconMediaId = null;
    }
  }

  /**
   * Set to true if the calling user follows this Application.
   */
  public boolean isIsFollowing() {
    return this.isFollowing;
  }

  /**
   * Set to true if the calling user follows this Application.
   */
  public Application setIsFollowing(boolean isFollowing) {
    this.isFollowing = isFollowing;
    setIsFollowingIsSet(true);
    return this;
  }

  public void unsetIsFollowing() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISFOLLOWING_ISSET_ID);
  }

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

  public void setIsFollowingIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISFOLLOWING_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case OWNERS:
      if (value == null) {
        unsetOwners();
      } else {
        setOwners((Set)value);
      }
      break;

    case TIME_OF_PROVISIONING:
      if (value == null) {
        unsetTimeOfProvisioning();
      } else {
        setTimeOfProvisioning((Long)value);
      }
      break;

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

    case APPLICATION_ID:
      if (value == null) {
        unsetApplicationId();
      } else {
        setApplicationId((String)value);
      }
      break;

    case TOTAL_MESSAGES_SENT:
      if (value == null) {
        unsetTotalMessagesSent();
      } else {
        setTotalMessagesSent((Long)value);
      }
      break;

    case ICON:
      if (value == null) {
        unsetIcon();
      } else {
        setIcon((Image)value);
      }
      break;

    case PROGRAMMING_LANGUAGE:
      if (value == null) {
        unsetProgrammingLanguage();
      } else {
        setProgrammingLanguage((ProgrammingLanguage)value);
      }
      break;

    case FOLLOWERS:
      if (value == null) {
        unsetFollowers();
      } else {
        setFollowers((Set)value);
      }
      break;

    case APPLICATION_DESCRIPTION:
      if (value == null) {
        unsetApplicationDescription();
      } else {
        setApplicationDescription((String)value);
      }
      break;

    case ORGANIZATION_ID:
      if (value == null) {
        unsetOrganizationId();
      } else {
        setOrganizationId((String)value);
      }
      break;

    case TIER:
      if (value == null) {
        unsetTier();
      } else {
        setTier((Tier)value);
      }
      break;

    case TIME_OF_TOKEN_EXPIRATION:
      if (value == null) {
        unsetTimeOfTokenExpiration();
      } else {
        setTimeOfTokenExpiration((Long)value);
      }
      break;

    case APPLICATION_ICON_MEDIA_ID:
      if (value == null) {
        unsetApplicationIconMediaId();
      } else {
        setApplicationIconMediaId((String)value);
      }
      break;

    case IS_FOLLOWING:
      if (value == null) {
        unsetIsFollowing();
      } else {
        setIsFollowing((Boolean)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case OWNERS:
      return getOwners();

    case TIME_OF_PROVISIONING:
      return getTimeOfProvisioning();

    case NAME:
      return getName();

    case APPLICATION_ID:
      return getApplicationId();

    case TOTAL_MESSAGES_SENT:
      return getTotalMessagesSent();

    case ICON:
      return getIcon();

    case PROGRAMMING_LANGUAGE:
      return getProgrammingLanguage();

    case FOLLOWERS:
      return getFollowers();

    case APPLICATION_DESCRIPTION:
      return getApplicationDescription();

    case ORGANIZATION_ID:
      return getOrganizationId();

    case TIER:
      return getTier();

    case TIME_OF_TOKEN_EXPIRATION:
      return getTimeOfTokenExpiration();

    case APPLICATION_ICON_MEDIA_ID:
      return getApplicationIconMediaId();

    case IS_FOLLOWING:
      return isIsFollowing();

    }
    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 OWNERS:
      return isSetOwners();
    case TIME_OF_PROVISIONING:
      return isSetTimeOfProvisioning();
    case NAME:
      return isSetName();
    case APPLICATION_ID:
      return isSetApplicationId();
    case TOTAL_MESSAGES_SENT:
      return isSetTotalMessagesSent();
    case ICON:
      return isSetIcon();
    case PROGRAMMING_LANGUAGE:
      return isSetProgrammingLanguage();
    case FOLLOWERS:
      return isSetFollowers();
    case APPLICATION_DESCRIPTION:
      return isSetApplicationDescription();
    case ORGANIZATION_ID:
      return isSetOrganizationId();
    case TIER:
      return isSetTier();
    case TIME_OF_TOKEN_EXPIRATION:
      return isSetTimeOfTokenExpiration();
    case APPLICATION_ICON_MEDIA_ID:
      return isSetApplicationIconMediaId();
    case IS_FOLLOWING:
      return isSetIsFollowing();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_owners = true && this.isSetOwners();
    boolean that_present_owners = true && that.isSetOwners();
    if (this_present_owners || that_present_owners) {
      if (!(this_present_owners && that_present_owners))
        return false;
      if (!this.owners.equals(that.owners))
        return false;
    }

    boolean this_present_timeOfProvisioning = true;
    boolean that_present_timeOfProvisioning = true;
    if (this_present_timeOfProvisioning || that_present_timeOfProvisioning) {
      if (!(this_present_timeOfProvisioning && that_present_timeOfProvisioning))
        return false;
      if (this.timeOfProvisioning != that.timeOfProvisioning)
        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_applicationId = true && this.isSetApplicationId();
    boolean that_present_applicationId = true && that.isSetApplicationId();
    if (this_present_applicationId || that_present_applicationId) {
      if (!(this_present_applicationId && that_present_applicationId))
        return false;
      if (!this.applicationId.equals(that.applicationId))
        return false;
    }

    boolean this_present_totalMessagesSent = true;
    boolean that_present_totalMessagesSent = true;
    if (this_present_totalMessagesSent || that_present_totalMessagesSent) {
      if (!(this_present_totalMessagesSent && that_present_totalMessagesSent))
        return false;
      if (this.totalMessagesSent != that.totalMessagesSent)
        return false;
    }

    boolean this_present_icon = true && this.isSetIcon();
    boolean that_present_icon = true && that.isSetIcon();
    if (this_present_icon || that_present_icon) {
      if (!(this_present_icon && that_present_icon))
        return false;
      if (!this.icon.equals(that.icon))
        return false;
    }

    boolean this_present_programmingLanguage = true && this.isSetProgrammingLanguage();
    boolean that_present_programmingLanguage = true && that.isSetProgrammingLanguage();
    if (this_present_programmingLanguage || that_present_programmingLanguage) {
      if (!(this_present_programmingLanguage && that_present_programmingLanguage))
        return false;
      if (!this.programmingLanguage.equals(that.programmingLanguage))
        return false;
    }

    boolean this_present_followers = true && this.isSetFollowers();
    boolean that_present_followers = true && that.isSetFollowers();
    if (this_present_followers || that_present_followers) {
      if (!(this_present_followers && that_present_followers))
        return false;
      if (!this.followers.equals(that.followers))
        return false;
    }

    boolean this_present_applicationDescription = true && this.isSetApplicationDescription();
    boolean that_present_applicationDescription = true && that.isSetApplicationDescription();
    if (this_present_applicationDescription || that_present_applicationDescription) {
      if (!(this_present_applicationDescription && that_present_applicationDescription))
        return false;
      if (!this.applicationDescription.equals(that.applicationDescription))
        return false;
    }

    boolean this_present_organizationId = true && this.isSetOrganizationId();
    boolean that_present_organizationId = true && that.isSetOrganizationId();
    if (this_present_organizationId || that_present_organizationId) {
      if (!(this_present_organizationId && that_present_organizationId))
        return false;
      if (!this.organizationId.equals(that.organizationId))
        return false;
    }

    boolean this_present_tier = true && this.isSetTier();
    boolean that_present_tier = true && that.isSetTier();
    if (this_present_tier || that_present_tier) {
      if (!(this_present_tier && that_present_tier))
        return false;
      if (!this.tier.equals(that.tier))
        return false;
    }

    boolean this_present_timeOfTokenExpiration = true;
    boolean that_present_timeOfTokenExpiration = true;
    if (this_present_timeOfTokenExpiration || that_present_timeOfTokenExpiration) {
      if (!(this_present_timeOfTokenExpiration && that_present_timeOfTokenExpiration))
        return false;
      if (this.timeOfTokenExpiration != that.timeOfTokenExpiration)
        return false;
    }

    boolean this_present_applicationIconMediaId = true && this.isSetApplicationIconMediaId();
    boolean that_present_applicationIconMediaId = true && that.isSetApplicationIconMediaId();
    if (this_present_applicationIconMediaId || that_present_applicationIconMediaId) {
      if (!(this_present_applicationIconMediaId && that_present_applicationIconMediaId))
        return false;
      if (!this.applicationIconMediaId.equals(that.applicationIconMediaId))
        return false;
    }

    boolean this_present_isFollowing = true && this.isSetIsFollowing();
    boolean that_present_isFollowing = true && that.isSetIsFollowing();
    if (this_present_isFollowing || that_present_isFollowing) {
      if (!(this_present_isFollowing && that_present_isFollowing))
        return false;
      if (this.isFollowing != that.isFollowing)
        return false;
    }

    return true;
  }

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

    boolean present_owners = true && (isSetOwners());
    list.add(present_owners);
    if (present_owners)
      list.add(owners);

    boolean present_timeOfProvisioning = true;
    list.add(present_timeOfProvisioning);
    if (present_timeOfProvisioning)
      list.add(timeOfProvisioning);

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

    boolean present_applicationId = true && (isSetApplicationId());
    list.add(present_applicationId);
    if (present_applicationId)
      list.add(applicationId);

    boolean present_totalMessagesSent = true;
    list.add(present_totalMessagesSent);
    if (present_totalMessagesSent)
      list.add(totalMessagesSent);

    boolean present_icon = true && (isSetIcon());
    list.add(present_icon);
    if (present_icon)
      list.add(icon);

    boolean present_programmingLanguage = true && (isSetProgrammingLanguage());
    list.add(present_programmingLanguage);
    if (present_programmingLanguage)
      list.add(programmingLanguage.getValue());

    boolean present_followers = true && (isSetFollowers());
    list.add(present_followers);
    if (present_followers)
      list.add(followers);

    boolean present_applicationDescription = true && (isSetApplicationDescription());
    list.add(present_applicationDescription);
    if (present_applicationDescription)
      list.add(applicationDescription);

    boolean present_organizationId = true && (isSetOrganizationId());
    list.add(present_organizationId);
    if (present_organizationId)
      list.add(organizationId);

    boolean present_tier = true && (isSetTier());
    list.add(present_tier);
    if (present_tier)
      list.add(tier.getValue());

    boolean present_timeOfTokenExpiration = true;
    list.add(present_timeOfTokenExpiration);
    if (present_timeOfTokenExpiration)
      list.add(timeOfTokenExpiration);

    boolean present_applicationIconMediaId = true && (isSetApplicationIconMediaId());
    list.add(present_applicationIconMediaId);
    if (present_applicationIconMediaId)
      list.add(applicationIconMediaId);

    boolean present_isFollowing = true && (isSetIsFollowing());
    list.add(present_isFollowing);
    if (present_isFollowing)
      list.add(isFollowing);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetOwners()).compareTo(other.isSetOwners());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwners()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owners, other.owners);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimeOfProvisioning()).compareTo(other.isSetTimeOfProvisioning());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeOfProvisioning()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeOfProvisioning, other.timeOfProvisioning);
      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(isSetApplicationId()).compareTo(other.isSetApplicationId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApplicationId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationId, other.applicationId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTotalMessagesSent()).compareTo(other.isSetTotalMessagesSent());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotalMessagesSent()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalMessagesSent, other.totalMessagesSent);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIcon()).compareTo(other.isSetIcon());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIcon()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.icon, other.icon);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProgrammingLanguage()).compareTo(other.isSetProgrammingLanguage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProgrammingLanguage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.programmingLanguage, other.programmingLanguage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFollowers()).compareTo(other.isSetFollowers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFollowers()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.followers, other.followers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetApplicationDescription()).compareTo(other.isSetApplicationDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApplicationDescription()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationDescription, other.applicationDescription);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOrganizationId()).compareTo(other.isSetOrganizationId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOrganizationId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organizationId, other.organizationId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTier()).compareTo(other.isSetTier());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTier()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tier, other.tier);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimeOfTokenExpiration()).compareTo(other.isSetTimeOfTokenExpiration());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeOfTokenExpiration()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeOfTokenExpiration, other.timeOfTokenExpiration);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetApplicationIconMediaId()).compareTo(other.isSetApplicationIconMediaId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApplicationIconMediaId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationIconMediaId, other.applicationIconMediaId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIsFollowing()).compareTo(other.isSetIsFollowing());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIsFollowing()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isFollowing, other.isFollowing);
      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("Application(");
    boolean first = true;

    sb.append("owners:");
    if (this.owners == null) {
      sb.append("null");
    } else {
      sb.append(this.owners);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("timeOfProvisioning:");
    sb.append(this.timeOfProvisioning);
    first = false;
    if (!first) sb.append(", ");
    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("applicationId:");
    if (this.applicationId == null) {
      sb.append("null");
    } else {
      sb.append(this.applicationId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("totalMessagesSent:");
    sb.append(this.totalMessagesSent);
    first = false;
    if (isSetIcon()) {
      if (!first) sb.append(", ");
      sb.append("icon:");
      if (this.icon == null) {
        sb.append("null");
      } else {
        sb.append(this.icon);
      }
      first = false;
    }
    if (isSetProgrammingLanguage()) {
      if (!first) sb.append(", ");
      sb.append("programmingLanguage:");
      if (this.programmingLanguage == null) {
        sb.append("null");
      } else {
        sb.append(this.programmingLanguage);
      }
      first = false;
    }
    if (isSetFollowers()) {
      if (!first) sb.append(", ");
      sb.append("followers:");
      if (this.followers == null) {
        sb.append("null");
      } else {
        sb.append(this.followers);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("applicationDescription:");
    if (this.applicationDescription == null) {
      sb.append("null");
    } else {
      sb.append(this.applicationDescription);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("organizationId:");
    if (this.organizationId == null) {
      sb.append("null");
    } else {
      sb.append(this.organizationId);
    }
    first = false;
    if (isSetTier()) {
      if (!first) sb.append(", ");
      sb.append("tier:");
      if (this.tier == null) {
        sb.append("null");
      } else {
        sb.append(this.tier);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("timeOfTokenExpiration:");
    sb.append(this.timeOfTokenExpiration);
    first = false;
    if (isSetApplicationIconMediaId()) {
      if (!first) sb.append(", ");
      sb.append("applicationIconMediaId:");
      if (this.applicationIconMediaId == null) {
        sb.append("null");
      } else {
        sb.append(this.applicationIconMediaId);
      }
      first = false;
    }
    if (isSetIsFollowing()) {
      if (!first) sb.append(", ");
      sb.append("isFollowing:");
      sb.append(this.isFollowing);
      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 (icon != null) {
      icon.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 ApplicationStandardSchemeFactory implements SchemeFactory {
    public ApplicationStandardScheme getScheme() {
      return new ApplicationStandardScheme();
    }
  }

  private static class ApplicationStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Application 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: // OWNERS
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set16 = iprot.readSetBegin();
                struct.owners = new HashSet(2*_set16.size);
                String _elem17;
                for (int _i18 = 0; _i18 < _set16.size; ++_i18)
                {
                  _elem17 = iprot.readString();
                  struct.owners.add(_elem17);
                }
                iprot.readSetEnd();
              }
              struct.setOwnersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TIME_OF_PROVISIONING
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timeOfProvisioning = iprot.readI64();
              struct.setTimeOfProvisioningIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // 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 4: // APPLICATION_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.applicationId = iprot.readString();
              struct.setApplicationIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // TOTAL_MESSAGES_SENT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.totalMessagesSent = iprot.readI64();
              struct.setTotalMessagesSentIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ICON
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.icon = new Image();
              struct.icon.read(iprot);
              struct.setIconIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PROGRAMMING_LANGUAGE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.programmingLanguage = tech.aroma.thrift.ProgrammingLanguage.findByValue(iprot.readI32());
              struct.setProgrammingLanguageIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // FOLLOWERS
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set19 = iprot.readSetBegin();
                struct.followers = new HashSet(2*_set19.size);
                String _elem20;
                for (int _i21 = 0; _i21 < _set19.size; ++_i21)
                {
                  _elem20 = iprot.readString();
                  struct.followers.add(_elem20);
                }
                iprot.readSetEnd();
              }
              struct.setFollowersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // APPLICATION_DESCRIPTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.applicationDescription = iprot.readString();
              struct.setApplicationDescriptionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // ORGANIZATION_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.organizationId = iprot.readString();
              struct.setOrganizationIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // TIER
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.tier = tech.aroma.thrift.Tier.findByValue(iprot.readI32());
              struct.setTierIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // TIME_OF_TOKEN_EXPIRATION
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timeOfTokenExpiration = iprot.readI64();
              struct.setTimeOfTokenExpirationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // APPLICATION_ICON_MEDIA_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.applicationIconMediaId = iprot.readString();
              struct.setApplicationIconMediaIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // IS_FOLLOWING
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.isFollowing = iprot.readBool();
              struct.setIsFollowingIsSet(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, Application struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.owners != null) {
        oprot.writeFieldBegin(OWNERS_FIELD_DESC);
        {
          oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.owners.size()));
          for (String _iter22 : struct.owners)
          {
            oprot.writeString(_iter22);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TIME_OF_PROVISIONING_FIELD_DESC);
      oprot.writeI64(struct.timeOfProvisioning);
      oprot.writeFieldEnd();
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.applicationId != null) {
        oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
        oprot.writeString(struct.applicationId);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TOTAL_MESSAGES_SENT_FIELD_DESC);
      oprot.writeI64(struct.totalMessagesSent);
      oprot.writeFieldEnd();
      if (struct.icon != null) {
        if (struct.isSetIcon()) {
          oprot.writeFieldBegin(ICON_FIELD_DESC);
          struct.icon.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.programmingLanguage != null) {
        if (struct.isSetProgrammingLanguage()) {
          oprot.writeFieldBegin(PROGRAMMING_LANGUAGE_FIELD_DESC);
          oprot.writeI32(struct.programmingLanguage.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.followers != null) {
        if (struct.isSetFollowers()) {
          oprot.writeFieldBegin(FOLLOWERS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.followers.size()));
            for (String _iter23 : struct.followers)
            {
              oprot.writeString(_iter23);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.applicationDescription != null) {
        oprot.writeFieldBegin(APPLICATION_DESCRIPTION_FIELD_DESC);
        oprot.writeString(struct.applicationDescription);
        oprot.writeFieldEnd();
      }
      if (struct.organizationId != null) {
        oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC);
        oprot.writeString(struct.organizationId);
        oprot.writeFieldEnd();
      }
      if (struct.tier != null) {
        if (struct.isSetTier()) {
          oprot.writeFieldBegin(TIER_FIELD_DESC);
          oprot.writeI32(struct.tier.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldBegin(TIME_OF_TOKEN_EXPIRATION_FIELD_DESC);
      oprot.writeI64(struct.timeOfTokenExpiration);
      oprot.writeFieldEnd();
      if (struct.applicationIconMediaId != null) {
        if (struct.isSetApplicationIconMediaId()) {
          oprot.writeFieldBegin(APPLICATION_ICON_MEDIA_ID_FIELD_DESC);
          oprot.writeString(struct.applicationIconMediaId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetIsFollowing()) {
        oprot.writeFieldBegin(IS_FOLLOWING_FIELD_DESC);
        oprot.writeBool(struct.isFollowing);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ApplicationTupleSchemeFactory implements SchemeFactory {
    public ApplicationTupleScheme getScheme() {
      return new ApplicationTupleScheme();
    }
  }

  private static class ApplicationTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Application struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetOwners()) {
        optionals.set(0);
      }
      if (struct.isSetTimeOfProvisioning()) {
        optionals.set(1);
      }
      if (struct.isSetName()) {
        optionals.set(2);
      }
      if (struct.isSetApplicationId()) {
        optionals.set(3);
      }
      if (struct.isSetTotalMessagesSent()) {
        optionals.set(4);
      }
      if (struct.isSetIcon()) {
        optionals.set(5);
      }
      if (struct.isSetProgrammingLanguage()) {
        optionals.set(6);
      }
      if (struct.isSetFollowers()) {
        optionals.set(7);
      }
      if (struct.isSetApplicationDescription()) {
        optionals.set(8);
      }
      if (struct.isSetOrganizationId()) {
        optionals.set(9);
      }
      if (struct.isSetTier()) {
        optionals.set(10);
      }
      if (struct.isSetTimeOfTokenExpiration()) {
        optionals.set(11);
      }
      if (struct.isSetApplicationIconMediaId()) {
        optionals.set(12);
      }
      if (struct.isSetIsFollowing()) {
        optionals.set(13);
      }
      oprot.writeBitSet(optionals, 14);
      if (struct.isSetOwners()) {
        {
          oprot.writeI32(struct.owners.size());
          for (String _iter24 : struct.owners)
          {
            oprot.writeString(_iter24);
          }
        }
      }
      if (struct.isSetTimeOfProvisioning()) {
        oprot.writeI64(struct.timeOfProvisioning);
      }
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetApplicationId()) {
        oprot.writeString(struct.applicationId);
      }
      if (struct.isSetTotalMessagesSent()) {
        oprot.writeI64(struct.totalMessagesSent);
      }
      if (struct.isSetIcon()) {
        struct.icon.write(oprot);
      }
      if (struct.isSetProgrammingLanguage()) {
        oprot.writeI32(struct.programmingLanguage.getValue());
      }
      if (struct.isSetFollowers()) {
        {
          oprot.writeI32(struct.followers.size());
          for (String _iter25 : struct.followers)
          {
            oprot.writeString(_iter25);
          }
        }
      }
      if (struct.isSetApplicationDescription()) {
        oprot.writeString(struct.applicationDescription);
      }
      if (struct.isSetOrganizationId()) {
        oprot.writeString(struct.organizationId);
      }
      if (struct.isSetTier()) {
        oprot.writeI32(struct.tier.getValue());
      }
      if (struct.isSetTimeOfTokenExpiration()) {
        oprot.writeI64(struct.timeOfTokenExpiration);
      }
      if (struct.isSetApplicationIconMediaId()) {
        oprot.writeString(struct.applicationIconMediaId);
      }
      if (struct.isSetIsFollowing()) {
        oprot.writeBool(struct.isFollowing);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Application struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(14);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TSet _set26 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.owners = new HashSet(2*_set26.size);
          String _elem27;
          for (int _i28 = 0; _i28 < _set26.size; ++_i28)
          {
            _elem27 = iprot.readString();
            struct.owners.add(_elem27);
          }
        }
        struct.setOwnersIsSet(true);
      }
      if (incoming.get(1)) {
        struct.timeOfProvisioning = iprot.readI64();
        struct.setTimeOfProvisioningIsSet(true);
      }
      if (incoming.get(2)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.applicationId = iprot.readString();
        struct.setApplicationIdIsSet(true);
      }
      if (incoming.get(4)) {
        struct.totalMessagesSent = iprot.readI64();
        struct.setTotalMessagesSentIsSet(true);
      }
      if (incoming.get(5)) {
        struct.icon = new Image();
        struct.icon.read(iprot);
        struct.setIconIsSet(true);
      }
      if (incoming.get(6)) {
        struct.programmingLanguage = tech.aroma.thrift.ProgrammingLanguage.findByValue(iprot.readI32());
        struct.setProgrammingLanguageIsSet(true);
      }
      if (incoming.get(7)) {
        {
          org.apache.thrift.protocol.TSet _set29 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.followers = new HashSet(2*_set29.size);
          String _elem30;
          for (int _i31 = 0; _i31 < _set29.size; ++_i31)
          {
            _elem30 = iprot.readString();
            struct.followers.add(_elem30);
          }
        }
        struct.setFollowersIsSet(true);
      }
      if (incoming.get(8)) {
        struct.applicationDescription = iprot.readString();
        struct.setApplicationDescriptionIsSet(true);
      }
      if (incoming.get(9)) {
        struct.organizationId = iprot.readString();
        struct.setOrganizationIdIsSet(true);
      }
      if (incoming.get(10)) {
        struct.tier = tech.aroma.thrift.Tier.findByValue(iprot.readI32());
        struct.setTierIsSet(true);
      }
      if (incoming.get(11)) {
        struct.timeOfTokenExpiration = iprot.readI64();
        struct.setTimeOfTokenExpirationIsSet(true);
      }
      if (incoming.get(12)) {
        struct.applicationIconMediaId = iprot.readString();
        struct.setApplicationIconMediaIdIsSet(true);
      }
      if (incoming.get(13)) {
        struct.isFollowing = iprot.readBool();
        struct.setIsFollowingIsSet(true);
      }
    }
  }

}