
tech.aroma.thrift.authentication.ApplicationToken Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aroma-thrift Show documentation
Show all versions of aroma-thrift Show documentation
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.
/**
* 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy