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

tech.aroma.thrift.authentication.ApplicationToken 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.authentication;

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 ApplicationToken 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("ApplicationToken");

  private static final org.apache.thrift.protocol.TField TOKEN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenId", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField TIME_OF_EXPIRATION_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfExpiration", org.apache.thrift.protocol.TType.I64, (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 APPLICATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationName", org.apache.thrift.protocol.TType.STRING, (short)5);

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

  public String tokenId; // required
  public String organization; // optional
  public long timeOfExpiration; // required
  public String applicationId; // optional
  public String applicationName; // 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_ID((short)1, "tokenId"),
    ORGANIZATION((short)2, "organization"),
    TIME_OF_EXPIRATION((short)3, "timeOfExpiration"),
    APPLICATION_ID((short)4, "applicationId"),
    APPLICATION_NAME((short)5, "applicationName");

    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_ID
          return TOKEN_ID;
        case 2: // ORGANIZATION
          return ORGANIZATION;
        case 3: // TIME_OF_EXPIRATION
          return TIME_OF_EXPIRATION;
        case 4: // APPLICATION_ID
          return APPLICATION_ID;
        case 5: // APPLICATION_NAME
          return APPLICATION_NAME;
        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 __TIMEOFEXPIRATION_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ORGANIZATION,_Fields.APPLICATION_ID,_Fields.APPLICATION_NAME};
  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_ID, new org.apache.thrift.meta_data.FieldMetaData("tokenId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TIME_OF_EXPIRATION, new org.apache.thrift.meta_data.FieldMetaData("timeOfExpiration", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "timestamp")));
    tmpMap.put(_Fields.APPLICATION_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "uuid")));
    tmpMap.put(_Fields.APPLICATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("applicationName", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ApplicationToken.class, metaDataMap);
  }

  public ApplicationToken() {
  }

  public ApplicationToken(
    String tokenId,
    long timeOfExpiration)
  {
    this();
    this.tokenId = tokenId;
    this.timeOfExpiration = timeOfExpiration;
    setTimeOfExpirationIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public ApplicationToken(ApplicationToken other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetTokenId()) {
      this.tokenId = other.tokenId;
    }
    if (other.isSetOrganization()) {
      this.organization = other.organization;
    }
    this.timeOfExpiration = other.timeOfExpiration;
    if (other.isSetApplicationId()) {
      this.applicationId = other.applicationId;
    }
    if (other.isSetApplicationName()) {
      this.applicationName = other.applicationName;
    }
  }

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

  @Override
  public void clear() {
    this.tokenId = null;
    this.organization = null;
    setTimeOfExpirationIsSet(false);
    this.timeOfExpiration = 0;
    this.applicationId = null;
    this.applicationName = null;
  }

  public String getTokenId() {
    return this.tokenId;
  }

  public ApplicationToken setTokenId(String tokenId) {
    this.tokenId = tokenId;
    return this;
  }

  public void unsetTokenId() {
    this.tokenId = null;
  }

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

  public void setTokenIdIsSet(boolean value) {
    if (!value) {
      this.tokenId = null;
    }
  }

  public String getOrganization() {
    return this.organization;
  }

  public ApplicationToken setOrganization(String organization) {
    this.organization = organization;
    return this;
  }

  public void unsetOrganization() {
    this.organization = null;
  }

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

  public void setOrganizationIsSet(boolean value) {
    if (!value) {
      this.organization = null;
    }
  }

  public long getTimeOfExpiration() {
    return this.timeOfExpiration;
  }

  public ApplicationToken setTimeOfExpiration(long timeOfExpiration) {
    this.timeOfExpiration = timeOfExpiration;
    setTimeOfExpirationIsSet(true);
    return this;
  }

  public void unsetTimeOfExpiration() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFEXPIRATION_ISSET_ID);
  }

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

  public void setTimeOfExpirationIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFEXPIRATION_ISSET_ID, value);
  }

  public String getApplicationId() {
    return this.applicationId;
  }

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

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

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

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case TOKEN_ID:
      if (value == null) {
        unsetTokenId();
      } else {
        setTokenId((String)value);
      }
      break;

    case ORGANIZATION:
      if (value == null) {
        unsetOrganization();
      } else {
        setOrganization((String)value);
      }
      break;

    case TIME_OF_EXPIRATION:
      if (value == null) {
        unsetTimeOfExpiration();
      } else {
        setTimeOfExpiration((Long)value);
      }
      break;

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

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

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case TOKEN_ID:
      return getTokenId();

    case ORGANIZATION:
      return getOrganization();

    case TIME_OF_EXPIRATION:
      return getTimeOfExpiration();

    case APPLICATION_ID:
      return getApplicationId();

    case APPLICATION_NAME:
      return getApplicationName();

    }
    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_ID:
      return isSetTokenId();
    case ORGANIZATION:
      return isSetOrganization();
    case TIME_OF_EXPIRATION:
      return isSetTimeOfExpiration();
    case APPLICATION_ID:
      return isSetApplicationId();
    case APPLICATION_NAME:
      return isSetApplicationName();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_tokenId = true && this.isSetTokenId();
    boolean that_present_tokenId = true && that.isSetTokenId();
    if (this_present_tokenId || that_present_tokenId) {
      if (!(this_present_tokenId && that_present_tokenId))
        return false;
      if (!this.tokenId.equals(that.tokenId))
        return false;
    }

    boolean this_present_organization = true && this.isSetOrganization();
    boolean that_present_organization = true && that.isSetOrganization();
    if (this_present_organization || that_present_organization) {
      if (!(this_present_organization && that_present_organization))
        return false;
      if (!this.organization.equals(that.organization))
        return false;
    }

    boolean this_present_timeOfExpiration = true;
    boolean that_present_timeOfExpiration = true;
    if (this_present_timeOfExpiration || that_present_timeOfExpiration) {
      if (!(this_present_timeOfExpiration && that_present_timeOfExpiration))
        return false;
      if (this.timeOfExpiration != that.timeOfExpiration)
        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_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;
    }

    return true;
  }

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

    boolean present_tokenId = true && (isSetTokenId());
    list.add(present_tokenId);
    if (present_tokenId)
      list.add(tokenId);

    boolean present_organization = true && (isSetOrganization());
    list.add(present_organization);
    if (present_organization)
      list.add(organization);

    boolean present_timeOfExpiration = true;
    list.add(present_timeOfExpiration);
    if (present_timeOfExpiration)
      list.add(timeOfExpiration);

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

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

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetTokenId()).compareTo(other.isSetTokenId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTokenId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tokenId, other.tokenId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOrganization()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimeOfExpiration()).compareTo(other.isSetTimeOfExpiration());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimeOfExpiration()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeOfExpiration, other.timeOfExpiration);
      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(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;
      }
    }
    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("ApplicationToken(");
    boolean first = true;

    sb.append("tokenId:");
    if (this.tokenId == null) {
      sb.append("null");
    } else {
      sb.append(this.tokenId);
    }
    first = false;
    if (isSetOrganization()) {
      if (!first) sb.append(", ");
      sb.append("organization:");
      if (this.organization == null) {
        sb.append("null");
      } else {
        sb.append(this.organization);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("timeOfExpiration:");
    sb.append(this.timeOfExpiration);
    first = false;
    if (isSetApplicationId()) {
      if (!first) sb.append(", ");
      sb.append("applicationId:");
      if (this.applicationId == null) {
        sb.append("null");
      } else {
        sb.append(this.applicationId);
      }
      first = false;
    }
    if (isSetApplicationName()) {
      if (!first) sb.append(", ");
      sb.append("applicationName:");
      if (this.applicationName == null) {
        sb.append("null");
      } else {
        sb.append(this.applicationName);
      }
      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 {
      // 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 ApplicationTokenStandardSchemeFactory implements SchemeFactory {
    public ApplicationTokenStandardScheme getScheme() {
      return new ApplicationTokenStandardScheme();
    }
  }

  private static class ApplicationTokenStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ApplicationToken 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_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.tokenId = iprot.readString();
              struct.setTokenIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ORGANIZATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.organization = iprot.readString();
              struct.setOrganizationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIME_OF_EXPIRATION
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timeOfExpiration = iprot.readI64();
              struct.setTimeOfExpirationIsSet(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: // 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;
          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, ApplicationToken struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.tokenId != null) {
        oprot.writeFieldBegin(TOKEN_ID_FIELD_DESC);
        oprot.writeString(struct.tokenId);
        oprot.writeFieldEnd();
      }
      if (struct.organization != null) {
        if (struct.isSetOrganization()) {
          oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC);
          oprot.writeString(struct.organization);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldBegin(TIME_OF_EXPIRATION_FIELD_DESC);
      oprot.writeI64(struct.timeOfExpiration);
      oprot.writeFieldEnd();
      if (struct.applicationId != null) {
        if (struct.isSetApplicationId()) {
          oprot.writeFieldBegin(APPLICATION_ID_FIELD_DESC);
          oprot.writeString(struct.applicationId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.applicationName != null) {
        if (struct.isSetApplicationName()) {
          oprot.writeFieldBegin(APPLICATION_NAME_FIELD_DESC);
          oprot.writeString(struct.applicationName);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ApplicationTokenTupleSchemeFactory implements SchemeFactory {
    public ApplicationTokenTupleScheme getScheme() {
      return new ApplicationTokenTupleScheme();
    }
  }

  private static class ApplicationTokenTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ApplicationToken struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTokenId()) {
        optionals.set(0);
      }
      if (struct.isSetOrganization()) {
        optionals.set(1);
      }
      if (struct.isSetTimeOfExpiration()) {
        optionals.set(2);
      }
      if (struct.isSetApplicationId()) {
        optionals.set(3);
      }
      if (struct.isSetApplicationName()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetTokenId()) {
        oprot.writeString(struct.tokenId);
      }
      if (struct.isSetOrganization()) {
        oprot.writeString(struct.organization);
      }
      if (struct.isSetTimeOfExpiration()) {
        oprot.writeI64(struct.timeOfExpiration);
      }
      if (struct.isSetApplicationId()) {
        oprot.writeString(struct.applicationId);
      }
      if (struct.isSetApplicationName()) {
        oprot.writeString(struct.applicationName);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ApplicationToken struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.tokenId = iprot.readString();
        struct.setTokenIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.organization = iprot.readString();
        struct.setOrganizationIsSet(true);
      }
      if (incoming.get(2)) {
        struct.timeOfExpiration = iprot.readI64();
        struct.setTimeOfExpirationIsSet(true);
      }
      if (incoming.get(3)) {
        struct.applicationId = iprot.readString();
        struct.setApplicationIdIsSet(true);
      }
      if (incoming.get(4)) {
        struct.applicationName = iprot.readString();
        struct.setApplicationNameIsSet(true);
      }
    }
  }

}