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

tech.aroma.thrift.service.ProvisionApplicationRequest 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.service;

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"})
/**
 * Defines the required information to provision
 * an Application with Aroma.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-10")
public class ProvisionApplicationRequest 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("ProvisionApplicationRequest");

  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)2);
  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)3);
  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)4);
  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)5);
  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)6);
  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)7);
  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)8);

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

  public tech.aroma.thrift.authentication.UserToken token; // required
  public String applicationName; // required
  /**
   * 
   * @see tech.aroma.thrift.ProgrammingLanguage
   */
  public tech.aroma.thrift.ProgrammingLanguage programmingLanguage; // optional
  public String organizationId; // required
  public tech.aroma.thrift.Image icon; // optional
  public Set owners; // optional
  public String applicationDescription; // optional
  /**
   * 
   * @see tech.aroma.thrift.Tier
   */
  public tech.aroma.thrift.Tier tier; // 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 {
    TOKEN((short)1, "token"),
    APPLICATION_NAME((short)2, "applicationName"),
    /**
     * 
     * @see tech.aroma.thrift.ProgrammingLanguage
     */
    PROGRAMMING_LANGUAGE((short)3, "programmingLanguage"),
    ORGANIZATION_ID((short)4, "organizationId"),
    ICON((short)5, "icon"),
    OWNERS((short)6, "owners"),
    APPLICATION_DESCRIPTION((short)7, "applicationDescription"),
    /**
     * 
     * @see tech.aroma.thrift.Tier
     */
    TIER((short)8, "tier");

    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: // TOKEN
          return TOKEN;
        case 2: // APPLICATION_NAME
          return APPLICATION_NAME;
        case 3: // PROGRAMMING_LANGUAGE
          return PROGRAMMING_LANGUAGE;
        case 4: // ORGANIZATION_ID
          return ORGANIZATION_ID;
        case 5: // ICON
          return ICON;
        case 6: // OWNERS
          return OWNERS;
        case 7: // APPLICATION_DESCRIPTION
          return APPLICATION_DESCRIPTION;
        case 8: // TIER
          return TIER;
        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 _Fields optionals[] = {_Fields.PROGRAMMING_LANGUAGE,_Fields.ICON,_Fields.OWNERS,_Fields.APPLICATION_DESCRIPTION,_Fields.TIER};
  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.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "UserToken")));
    tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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, tech.aroma.thrift.ProgrammingLanguage.class)));
    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.ICON, new org.apache.thrift.meta_data.FieldMetaData("icon", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "Image")));
    tmpMap.put(_Fields.OWNERS, new org.apache.thrift.meta_data.FieldMetaData("owners", 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.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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, tech.aroma.thrift.Tier.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProvisionApplicationRequest.class, metaDataMap);
  }

  public ProvisionApplicationRequest() {
    this.applicationDescription = "";

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

  }

  public ProvisionApplicationRequest(
    tech.aroma.thrift.authentication.UserToken token,
    String applicationName,
    String organizationId)
  {
    this();
    this.token = token;
    this.applicationName = applicationName;
    this.organizationId = organizationId;
  }

  /**
   * Performs a deep copy on other.
   */
  public ProvisionApplicationRequest(ProvisionApplicationRequest other) {
    if (other.isSetToken()) {
      this.token = other.token;
    }
    if (other.isSetApplicationName()) {
      this.applicationName = other.applicationName;
    }
    if (other.isSetProgrammingLanguage()) {
      this.programmingLanguage = other.programmingLanguage;
    }
    if (other.isSetOrganizationId()) {
      this.organizationId = other.organizationId;
    }
    if (other.isSetIcon()) {
      this.icon = other.icon;
    }
    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;
    }
    if (other.isSetApplicationDescription()) {
      this.applicationDescription = other.applicationDescription;
    }
    if (other.isSetTier()) {
      this.tier = other.tier;
    }
  }

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

  @Override
  public void clear() {
    this.token = null;
    this.applicationName = null;
    this.programmingLanguage = null;
    this.organizationId = null;
    this.icon = null;
    this.owners = null;
    this.applicationDescription = "";

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

  }

  public tech.aroma.thrift.authentication.UserToken getToken() {
    return this.token;
  }

  public ProvisionApplicationRequest setToken(tech.aroma.thrift.authentication.UserToken token) {
    this.token = token;
    return this;
  }

  public void unsetToken() {
    this.token = null;
  }

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

  public void setTokenIsSet(boolean value) {
    if (!value) {
      this.token = null;
    }
  }

  public String getApplicationName() {
    return this.applicationName;
  }

  public ProvisionApplicationRequest setApplicationName(String applicationName) {
    this.applicationName = applicationName;
    return this;
  }

  public void unsetApplicationName() {
    this.applicationName = null;
  }

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

  public void setApplicationNameIsSet(boolean value) {
    if (!value) {
      this.applicationName = null;
    }
  }

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

  /**
   * 
   * @see tech.aroma.thrift.ProgrammingLanguage
   */
  public ProvisionApplicationRequest setProgrammingLanguage(tech.aroma.thrift.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 String getOrganizationId() {
    return this.organizationId;
  }

  public ProvisionApplicationRequest 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;
    }
  }

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

  public ProvisionApplicationRequest setIcon(tech.aroma.thrift.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;
    }
  }

  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);
  }

  public Set getOwners() {
    return this.owners;
  }

  public ProvisionApplicationRequest 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;
    }
  }

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

  public ProvisionApplicationRequest 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;
    }
  }

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

  /**
   * 
   * @see tech.aroma.thrift.Tier
   */
  public ProvisionApplicationRequest setTier(tech.aroma.thrift.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;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TOKEN:
      if (value == null) {
        unsetToken();
      } else {
        setToken((tech.aroma.thrift.authentication.UserToken)value);
      }
      break;

    case APPLICATION_NAME:
      if (value == null) {
        unsetApplicationName();
      } else {
        setApplicationName((String)value);
      }
      break;

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

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

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

    case OWNERS:
      if (value == null) {
        unsetOwners();
      } else {
        setOwners((Set)value);
      }
      break;

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

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

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TOKEN:
      return getToken();

    case APPLICATION_NAME:
      return getApplicationName();

    case PROGRAMMING_LANGUAGE:
      return getProgrammingLanguage();

    case ORGANIZATION_ID:
      return getOrganizationId();

    case ICON:
      return getIcon();

    case OWNERS:
      return getOwners();

    case APPLICATION_DESCRIPTION:
      return getApplicationDescription();

    case TIER:
      return getTier();

    }
    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 TOKEN:
      return isSetToken();
    case APPLICATION_NAME:
      return isSetApplicationName();
    case PROGRAMMING_LANGUAGE:
      return isSetProgrammingLanguage();
    case ORGANIZATION_ID:
      return isSetOrganizationId();
    case ICON:
      return isSetIcon();
    case OWNERS:
      return isSetOwners();
    case APPLICATION_DESCRIPTION:
      return isSetApplicationDescription();
    case TIER:
      return isSetTier();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_token = true && this.isSetToken();
    boolean that_present_token = true && that.isSetToken();
    if (this_present_token || that_present_token) {
      if (!(this_present_token && that_present_token))
        return false;
      if (!this.token.equals(that.token))
        return false;
    }

    boolean this_present_applicationName = true && this.isSetApplicationName();
    boolean that_present_applicationName = true && that.isSetApplicationName();
    if (this_present_applicationName || that_present_applicationName) {
      if (!(this_present_applicationName && that_present_applicationName))
        return false;
      if (!this.applicationName.equals(that.applicationName))
        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_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_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_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_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_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;
    }

    return true;
  }

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

    boolean present_token = true && (isSetToken());
    list.add(present_token);
    if (present_token)
      list.add(token);

    boolean present_applicationName = true && (isSetApplicationName());
    list.add(present_applicationName);
    if (present_applicationName)
      list.add(applicationName);

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

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

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

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

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

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

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetToken()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetApplicationName()).compareTo(other.isSetApplicationName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApplicationName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.applicationName, other.applicationName);
      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(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(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(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(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(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;
      }
    }
    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("ProvisionApplicationRequest(");
    boolean first = true;

    sb.append("token:");
    if (this.token == null) {
      sb.append("null");
    } else {
      sb.append(this.token);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("applicationName:");
    if (this.applicationName == null) {
      sb.append("null");
    } else {
      sb.append(this.applicationName);
    }
    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 (!first) sb.append(", ");
    sb.append("organizationId:");
    if (this.organizationId == null) {
      sb.append("null");
    } else {
      sb.append(this.organizationId);
    }
    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 (isSetOwners()) {
      if (!first) sb.append(", ");
      sb.append("owners:");
      if (this.owners == null) {
        sb.append("null");
      } else {
        sb.append(this.owners);
      }
      first = false;
    }
    if (isSetApplicationDescription()) {
      if (!first) sb.append(", ");
      sb.append("applicationDescription:");
      if (this.applicationDescription == null) {
        sb.append("null");
      } else {
        sb.append(this.applicationDescription);
      }
      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;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  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 {
      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 ProvisionApplicationRequestStandardSchemeFactory implements SchemeFactory {
    public ProvisionApplicationRequestStandardScheme getScheme() {
      return new ProvisionApplicationRequestStandardScheme();
    }
  }

  private static class ProvisionApplicationRequestStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ProvisionApplicationRequest 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: // TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.token = new tech.aroma.thrift.authentication.UserToken();
              struct.token.read(iprot);
              struct.setTokenIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // APPLICATION_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.applicationName = iprot.readString();
              struct.setApplicationNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // 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 4: // 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 5: // ICON
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.icon = new tech.aroma.thrift.Image();
              struct.icon.read(iprot);
              struct.setIconIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // OWNERS
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set24 = iprot.readSetBegin();
                struct.owners = new HashSet(2*_set24.size);
                String _elem25;
                for (int _i26 = 0; _i26 < _set24.size; ++_i26)
                {
                  _elem25 = iprot.readString();
                  struct.owners.add(_elem25);
                }
                iprot.readSetEnd();
              }
              struct.setOwnersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // 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 8: // 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;
          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, ProvisionApplicationRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.token != null) {
        oprot.writeFieldBegin(TOKEN_FIELD_DESC);
        struct.token.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.applicationName != null) {
        oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC);
        oprot.writeString(struct.applicationName);
        oprot.writeFieldEnd();
      }
      if (struct.programmingLanguage != null) {
        if (struct.isSetProgrammingLanguage()) {
          oprot.writeFieldBegin(PROGRAMMING_LANGUAGE_FIELD_DESC);
          oprot.writeI32(struct.programmingLanguage.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.organizationId != null) {
        oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC);
        oprot.writeString(struct.organizationId);
        oprot.writeFieldEnd();
      }
      if (struct.icon != null) {
        if (struct.isSetIcon()) {
          oprot.writeFieldBegin(ICON_FIELD_DESC);
          struct.icon.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.owners != null) {
        if (struct.isSetOwners()) {
          oprot.writeFieldBegin(OWNERS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.owners.size()));
            for (String _iter27 : struct.owners)
            {
              oprot.writeString(_iter27);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.applicationDescription != null) {
        if (struct.isSetApplicationDescription()) {
          oprot.writeFieldBegin(APPLICATION_DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.applicationDescription);
          oprot.writeFieldEnd();
        }
      }
      if (struct.tier != null) {
        if (struct.isSetTier()) {
          oprot.writeFieldBegin(TIER_FIELD_DESC);
          oprot.writeI32(struct.tier.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ProvisionApplicationRequestTupleSchemeFactory implements SchemeFactory {
    public ProvisionApplicationRequestTupleScheme getScheme() {
      return new ProvisionApplicationRequestTupleScheme();
    }
  }

  private static class ProvisionApplicationRequestTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ProvisionApplicationRequest struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetToken()) {
        optionals.set(0);
      }
      if (struct.isSetApplicationName()) {
        optionals.set(1);
      }
      if (struct.isSetProgrammingLanguage()) {
        optionals.set(2);
      }
      if (struct.isSetOrganizationId()) {
        optionals.set(3);
      }
      if (struct.isSetIcon()) {
        optionals.set(4);
      }
      if (struct.isSetOwners()) {
        optionals.set(5);
      }
      if (struct.isSetApplicationDescription()) {
        optionals.set(6);
      }
      if (struct.isSetTier()) {
        optionals.set(7);
      }
      oprot.writeBitSet(optionals, 8);
      if (struct.isSetToken()) {
        struct.token.write(oprot);
      }
      if (struct.isSetApplicationName()) {
        oprot.writeString(struct.applicationName);
      }
      if (struct.isSetProgrammingLanguage()) {
        oprot.writeI32(struct.programmingLanguage.getValue());
      }
      if (struct.isSetOrganizationId()) {
        oprot.writeString(struct.organizationId);
      }
      if (struct.isSetIcon()) {
        struct.icon.write(oprot);
      }
      if (struct.isSetOwners()) {
        {
          oprot.writeI32(struct.owners.size());
          for (String _iter28 : struct.owners)
          {
            oprot.writeString(_iter28);
          }
        }
      }
      if (struct.isSetApplicationDescription()) {
        oprot.writeString(struct.applicationDescription);
      }
      if (struct.isSetTier()) {
        oprot.writeI32(struct.tier.getValue());
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ProvisionApplicationRequest struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(8);
      if (incoming.get(0)) {
        struct.token = new tech.aroma.thrift.authentication.UserToken();
        struct.token.read(iprot);
        struct.setTokenIsSet(true);
      }
      if (incoming.get(1)) {
        struct.applicationName = iprot.readString();
        struct.setApplicationNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.programmingLanguage = tech.aroma.thrift.ProgrammingLanguage.findByValue(iprot.readI32());
        struct.setProgrammingLanguageIsSet(true);
      }
      if (incoming.get(3)) {
        struct.organizationId = iprot.readString();
        struct.setOrganizationIdIsSet(true);
      }
      if (incoming.get(4)) {
        struct.icon = new tech.aroma.thrift.Image();
        struct.icon.read(iprot);
        struct.setIconIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TSet _set29 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.owners = new HashSet(2*_set29.size);
          String _elem30;
          for (int _i31 = 0; _i31 < _set29.size; ++_i31)
          {
            _elem30 = iprot.readString();
            struct.owners.add(_elem30);
          }
        }
        struct.setOwnersIsSet(true);
      }
      if (incoming.get(6)) {
        struct.applicationDescription = iprot.readString();
        struct.setApplicationDescriptionIsSet(true);
      }
      if (incoming.get(7)) {
        struct.tier = tech.aroma.thrift.Tier.findByValue(iprot.readI32());
        struct.setTierIsSet(true);
      }
    }
  }

}