com.evernote.edam.type.User Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.evernote.edam.type;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import com.evernote.thrift.*;
import com.evernote.thrift.protocol.*;
/**
* This represents the information about a single user account.
*
* - id
* - The unique numeric identifier for the account, which will not
* change for the lifetime of the account.
*
*
* - username
* - The name that uniquely identifies a single user account. This name
* may be presented by the user, along with their password, to log into
* their account.
* May only contain a-z, 0-9, or '-', and may not start or end with the '-'
*
* Length: EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX
*
* Regex: EDAM_USER_USERNAME_REGEX
*
*
* - email
* - The email address registered for the user. Must comply with
* RFC 2821 and RFC 2822.
* Third party applications that authenticate using OAuth do not have
* access to this field.
* Length: EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX
*
* Regex: EDAM_EMAIL_REGEX
*
*
* - name
* - The printable name of the user, which may be a combination
* of given and family names. This is used instead of separate "first"
* and "last" names due to variations in international name format/order.
* May not start or end with a whitespace character. May contain any
* character but carriage return or newline (Unicode classes Zl and Zp).
*
* Length: EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX
*
* Regex: EDAM_USER_NAME_REGEX
*
*
* - timezone
* - The zone ID for the user's default location. If present,
* this may be used to localize the display of any timestamp for which no
* other timezone is available.
* The format must be encoded as a standard zone ID such as
* "America/Los_Angeles" or "GMT+08:00"
*
* Length: EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX
*
* Regex: EDAM_TIMEZONE_REGEX
*
*
* - privilege
* - The level of access permitted for the user.
*
*
* - created
* - The date and time when this user account was created in the
* service.
*
*
* - updated
* - The date and time when this user account was last modified
* in the service.
*
*
* - deleted
* - If the account has been deleted from the system (e.g. as
* the result of a legal request by the user), the date and time of the
* deletion will be represented here. If not, this value will not be set.
*
*
* - active
* - If the user account is available for login and
* synchronization, this flag will be set to true.
*
*
* - shardId
* - DEPRECATED - Client applications should have no need to use this field.
*
*
* - attributes
* - If present, this will contain a list of the attributes
* for this user account.
*
*
* - accounting
* - Bookkeeping information for the user's subscription.
*
*
* - premiumInfo
* - If present, this will contain a set of commerce information
* relating to the user's premium service level.
*
*
* - businessUserInfo
* - If present, this will contain a set of business information
* relating to the user's business membership. If not present, the
* user is not currently part of a business.
*
*
*/
public class User implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("User");
private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1);
private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)2);
private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)3);
private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)4);
private static final TField TIMEZONE_FIELD_DESC = new TField("timezone", TType.STRING, (short)6);
private static final TField PRIVILEGE_FIELD_DESC = new TField("privilege", TType.I32, (short)7);
private static final TField CREATED_FIELD_DESC = new TField("created", TType.I64, (short)9);
private static final TField UPDATED_FIELD_DESC = new TField("updated", TType.I64, (short)10);
private static final TField DELETED_FIELD_DESC = new TField("deleted", TType.I64, (short)11);
private static final TField ACTIVE_FIELD_DESC = new TField("active", TType.BOOL, (short)13);
private static final TField SHARD_ID_FIELD_DESC = new TField("shardId", TType.STRING, (short)14);
private static final TField ATTRIBUTES_FIELD_DESC = new TField("attributes", TType.STRUCT, (short)15);
private static final TField ACCOUNTING_FIELD_DESC = new TField("accounting", TType.STRUCT, (short)16);
private static final TField PREMIUM_INFO_FIELD_DESC = new TField("premiumInfo", TType.STRUCT, (short)17);
private static final TField BUSINESS_USER_INFO_FIELD_DESC = new TField("businessUserInfo", TType.STRUCT, (short)18);
private int id;
private String username;
private String email;
private String name;
private String timezone;
private PrivilegeLevel privilege;
private long created;
private long updated;
private long deleted;
private boolean active;
private String shardId;
private UserAttributes attributes;
private Accounting accounting;
private PremiumInfo premiumInfo;
private BusinessUserInfo businessUserInfo;
// isset id assignments
private static final int __ID_ISSET_ID = 0;
private static final int __CREATED_ISSET_ID = 1;
private static final int __UPDATED_ISSET_ID = 2;
private static final int __DELETED_ISSET_ID = 3;
private static final int __ACTIVE_ISSET_ID = 4;
private boolean[] __isset_vector = new boolean[5];
public User() {
}
/**
* Performs a deep copy on other.
*/
public User(User other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
this.id = other.id;
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetEmail()) {
this.email = other.email;
}
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetTimezone()) {
this.timezone = other.timezone;
}
if (other.isSetPrivilege()) {
this.privilege = other.privilege;
}
this.created = other.created;
this.updated = other.updated;
this.deleted = other.deleted;
this.active = other.active;
if (other.isSetShardId()) {
this.shardId = other.shardId;
}
if (other.isSetAttributes()) {
this.attributes = new UserAttributes(other.attributes);
}
if (other.isSetAccounting()) {
this.accounting = new Accounting(other.accounting);
}
if (other.isSetPremiumInfo()) {
this.premiumInfo = new PremiumInfo(other.premiumInfo);
}
if (other.isSetBusinessUserInfo()) {
this.businessUserInfo = new BusinessUserInfo(other.businessUserInfo);
}
}
public User deepCopy() {
return new User(this);
}
public void clear() {
setIdIsSet(false);
this.id = 0;
this.username = null;
this.email = null;
this.name = null;
this.timezone = null;
this.privilege = null;
setCreatedIsSet(false);
this.created = 0;
setUpdatedIsSet(false);
this.updated = 0;
setDeletedIsSet(false);
this.deleted = 0;
setActiveIsSet(false);
this.active = false;
this.shardId = null;
this.attributes = null;
this.accounting = null;
this.premiumInfo = null;
this.businessUserInfo = null;
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
setIdIsSet(true);
}
public void unsetId() {
__isset_vector[__ID_ISSET_ID] = false;
}
/** Returns true if field id is set (has been asigned a value) and false otherwise */
public boolean isSetId() {
return __isset_vector[__ID_ISSET_ID];
}
public void setIdIsSet(boolean value) {
__isset_vector[__ID_ISSET_ID] = value;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been asigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public void unsetEmail() {
this.email = null;
}
/** Returns true if field email is set (has been asigned a value) and false otherwise */
public boolean isSetEmail() {
return this.email != null;
}
public void setEmailIsSet(boolean value) {
if (!value) {
this.email = null;
}
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been asigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
public String getTimezone() {
return this.timezone;
}
public void setTimezone(String timezone) {
this.timezone = timezone;
}
public void unsetTimezone() {
this.timezone = null;
}
/** Returns true if field timezone is set (has been asigned a value) and false otherwise */
public boolean isSetTimezone() {
return this.timezone != null;
}
public void setTimezoneIsSet(boolean value) {
if (!value) {
this.timezone = null;
}
}
/**
*
* @see PrivilegeLevel
*/
public PrivilegeLevel getPrivilege() {
return this.privilege;
}
/**
*
* @see PrivilegeLevel
*/
public void setPrivilege(PrivilegeLevel privilege) {
this.privilege = privilege;
}
public void unsetPrivilege() {
this.privilege = null;
}
/** Returns true if field privilege is set (has been asigned a value) and false otherwise */
public boolean isSetPrivilege() {
return this.privilege != null;
}
public void setPrivilegeIsSet(boolean value) {
if (!value) {
this.privilege = null;
}
}
public long getCreated() {
return this.created;
}
public void setCreated(long created) {
this.created = created;
setCreatedIsSet(true);
}
public void unsetCreated() {
__isset_vector[__CREATED_ISSET_ID] = false;
}
/** Returns true if field created is set (has been asigned a value) and false otherwise */
public boolean isSetCreated() {
return __isset_vector[__CREATED_ISSET_ID];
}
public void setCreatedIsSet(boolean value) {
__isset_vector[__CREATED_ISSET_ID] = value;
}
public long getUpdated() {
return this.updated;
}
public void setUpdated(long updated) {
this.updated = updated;
setUpdatedIsSet(true);
}
public void unsetUpdated() {
__isset_vector[__UPDATED_ISSET_ID] = false;
}
/** Returns true if field updated is set (has been asigned a value) and false otherwise */
public boolean isSetUpdated() {
return __isset_vector[__UPDATED_ISSET_ID];
}
public void setUpdatedIsSet(boolean value) {
__isset_vector[__UPDATED_ISSET_ID] = value;
}
public long getDeleted() {
return this.deleted;
}
public void setDeleted(long deleted) {
this.deleted = deleted;
setDeletedIsSet(true);
}
public void unsetDeleted() {
__isset_vector[__DELETED_ISSET_ID] = false;
}
/** Returns true if field deleted is set (has been asigned a value) and false otherwise */
public boolean isSetDeleted() {
return __isset_vector[__DELETED_ISSET_ID];
}
public void setDeletedIsSet(boolean value) {
__isset_vector[__DELETED_ISSET_ID] = value;
}
public boolean isActive() {
return this.active;
}
public void setActive(boolean active) {
this.active = active;
setActiveIsSet(true);
}
public void unsetActive() {
__isset_vector[__ACTIVE_ISSET_ID] = false;
}
/** Returns true if field active is set (has been asigned a value) and false otherwise */
public boolean isSetActive() {
return __isset_vector[__ACTIVE_ISSET_ID];
}
public void setActiveIsSet(boolean value) {
__isset_vector[__ACTIVE_ISSET_ID] = value;
}
public String getShardId() {
return this.shardId;
}
public void setShardId(String shardId) {
this.shardId = shardId;
}
public void unsetShardId() {
this.shardId = null;
}
/** Returns true if field shardId is set (has been asigned a value) and false otherwise */
public boolean isSetShardId() {
return this.shardId != null;
}
public void setShardIdIsSet(boolean value) {
if (!value) {
this.shardId = null;
}
}
public UserAttributes getAttributes() {
return this.attributes;
}
public void setAttributes(UserAttributes attributes) {
this.attributes = attributes;
}
public void unsetAttributes() {
this.attributes = null;
}
/** Returns true if field attributes is set (has been asigned a value) and false otherwise */
public boolean isSetAttributes() {
return this.attributes != null;
}
public void setAttributesIsSet(boolean value) {
if (!value) {
this.attributes = null;
}
}
public Accounting getAccounting() {
return this.accounting;
}
public void setAccounting(Accounting accounting) {
this.accounting = accounting;
}
public void unsetAccounting() {
this.accounting = null;
}
/** Returns true if field accounting is set (has been asigned a value) and false otherwise */
public boolean isSetAccounting() {
return this.accounting != null;
}
public void setAccountingIsSet(boolean value) {
if (!value) {
this.accounting = null;
}
}
public PremiumInfo getPremiumInfo() {
return this.premiumInfo;
}
public void setPremiumInfo(PremiumInfo premiumInfo) {
this.premiumInfo = premiumInfo;
}
public void unsetPremiumInfo() {
this.premiumInfo = null;
}
/** Returns true if field premiumInfo is set (has been asigned a value) and false otherwise */
public boolean isSetPremiumInfo() {
return this.premiumInfo != null;
}
public void setPremiumInfoIsSet(boolean value) {
if (!value) {
this.premiumInfo = null;
}
}
public BusinessUserInfo getBusinessUserInfo() {
return this.businessUserInfo;
}
public void setBusinessUserInfo(BusinessUserInfo businessUserInfo) {
this.businessUserInfo = businessUserInfo;
}
public void unsetBusinessUserInfo() {
this.businessUserInfo = null;
}
/** Returns true if field businessUserInfo is set (has been asigned a value) and false otherwise */
public boolean isSetBusinessUserInfo() {
return this.businessUserInfo != null;
}
public void setBusinessUserInfoIsSet(boolean value) {
if (!value) {
this.businessUserInfo = null;
}
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof User)
return this.equals((User)that);
return false;
}
public boolean equals(User that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (this.id != that.id)
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_email = true && this.isSetEmail();
boolean that_present_email = true && that.isSetEmail();
if (this_present_email || that_present_email) {
if (!(this_present_email && that_present_email))
return false;
if (!this.email.equals(that.email))
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_timezone = true && this.isSetTimezone();
boolean that_present_timezone = true && that.isSetTimezone();
if (this_present_timezone || that_present_timezone) {
if (!(this_present_timezone && that_present_timezone))
return false;
if (!this.timezone.equals(that.timezone))
return false;
}
boolean this_present_privilege = true && this.isSetPrivilege();
boolean that_present_privilege = true && that.isSetPrivilege();
if (this_present_privilege || that_present_privilege) {
if (!(this_present_privilege && that_present_privilege))
return false;
if (!this.privilege.equals(that.privilege))
return false;
}
boolean this_present_created = true && this.isSetCreated();
boolean that_present_created = true && that.isSetCreated();
if (this_present_created || that_present_created) {
if (!(this_present_created && that_present_created))
return false;
if (this.created != that.created)
return false;
}
boolean this_present_updated = true && this.isSetUpdated();
boolean that_present_updated = true && that.isSetUpdated();
if (this_present_updated || that_present_updated) {
if (!(this_present_updated && that_present_updated))
return false;
if (this.updated != that.updated)
return false;
}
boolean this_present_deleted = true && this.isSetDeleted();
boolean that_present_deleted = true && that.isSetDeleted();
if (this_present_deleted || that_present_deleted) {
if (!(this_present_deleted && that_present_deleted))
return false;
if (this.deleted != that.deleted)
return false;
}
boolean this_present_active = true && this.isSetActive();
boolean that_present_active = true && that.isSetActive();
if (this_present_active || that_present_active) {
if (!(this_present_active && that_present_active))
return false;
if (this.active != that.active)
return false;
}
boolean this_present_shardId = true && this.isSetShardId();
boolean that_present_shardId = true && that.isSetShardId();
if (this_present_shardId || that_present_shardId) {
if (!(this_present_shardId && that_present_shardId))
return false;
if (!this.shardId.equals(that.shardId))
return false;
}
boolean this_present_attributes = true && this.isSetAttributes();
boolean that_present_attributes = true && that.isSetAttributes();
if (this_present_attributes || that_present_attributes) {
if (!(this_present_attributes && that_present_attributes))
return false;
if (!this.attributes.equals(that.attributes))
return false;
}
boolean this_present_accounting = true && this.isSetAccounting();
boolean that_present_accounting = true && that.isSetAccounting();
if (this_present_accounting || that_present_accounting) {
if (!(this_present_accounting && that_present_accounting))
return false;
if (!this.accounting.equals(that.accounting))
return false;
}
boolean this_present_premiumInfo = true && this.isSetPremiumInfo();
boolean that_present_premiumInfo = true && that.isSetPremiumInfo();
if (this_present_premiumInfo || that_present_premiumInfo) {
if (!(this_present_premiumInfo && that_present_premiumInfo))
return false;
if (!this.premiumInfo.equals(that.premiumInfo))
return false;
}
boolean this_present_businessUserInfo = true && this.isSetBusinessUserInfo();
boolean that_present_businessUserInfo = true && that.isSetBusinessUserInfo();
if (this_present_businessUserInfo || that_present_businessUserInfo) {
if (!(this_present_businessUserInfo && that_present_businessUserInfo))
return false;
if (!this.businessUserInfo.equals(that.businessUserInfo))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(User other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
User typedOther = (User)other;
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) { lastComparison = TBaseHelper.compareTo(this.id, typedOther.id);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) { lastComparison = TBaseHelper.compareTo(this.username, typedOther.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEmail()) { lastComparison = TBaseHelper.compareTo(this.email, typedOther.email);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) { lastComparison = TBaseHelper.compareTo(this.name, typedOther.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTimezone()).compareTo(typedOther.isSetTimezone());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTimezone()) { lastComparison = TBaseHelper.compareTo(this.timezone, typedOther.timezone);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPrivilege()).compareTo(typedOther.isSetPrivilege());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPrivilege()) { lastComparison = TBaseHelper.compareTo(this.privilege, typedOther.privilege);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCreated()).compareTo(typedOther.isSetCreated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCreated()) { lastComparison = TBaseHelper.compareTo(this.created, typedOther.created);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUpdated()).compareTo(typedOther.isSetUpdated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUpdated()) { lastComparison = TBaseHelper.compareTo(this.updated, typedOther.updated);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDeleted()).compareTo(typedOther.isSetDeleted());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDeleted()) { lastComparison = TBaseHelper.compareTo(this.deleted, typedOther.deleted);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetActive()).compareTo(typedOther.isSetActive());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetActive()) { lastComparison = TBaseHelper.compareTo(this.active, typedOther.active);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetShardId()).compareTo(typedOther.isSetShardId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetShardId()) { lastComparison = TBaseHelper.compareTo(this.shardId, typedOther.shardId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(typedOther.isSetAttributes());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAttributes()) { lastComparison = TBaseHelper.compareTo(this.attributes, typedOther.attributes);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetAccounting()).compareTo(typedOther.isSetAccounting());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetAccounting()) { lastComparison = TBaseHelper.compareTo(this.accounting, typedOther.accounting);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPremiumInfo()).compareTo(typedOther.isSetPremiumInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPremiumInfo()) { lastComparison = TBaseHelper.compareTo(this.premiumInfo, typedOther.premiumInfo);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBusinessUserInfo()).compareTo(typedOther.isSetBusinessUserInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBusinessUserInfo()) { lastComparison = TBaseHelper.compareTo(this.businessUserInfo, typedOther.businessUserInfo);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch (field.id) {
case 1: // ID
if (field.type == TType.I32) {
this.id = iprot.readI32();
setIdIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // USERNAME
if (field.type == TType.STRING) {
this.username = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // EMAIL
if (field.type == TType.STRING) {
this.email = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // NAME
if (field.type == TType.STRING) {
this.name = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // TIMEZONE
if (field.type == TType.STRING) {
this.timezone = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // PRIVILEGE
if (field.type == TType.I32) {
this.privilege = PrivilegeLevel.findByValue(iprot.readI32());
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 9: // CREATED
if (field.type == TType.I64) {
this.created = iprot.readI64();
setCreatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 10: // UPDATED
if (field.type == TType.I64) {
this.updated = iprot.readI64();
setUpdatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 11: // DELETED
if (field.type == TType.I64) {
this.deleted = iprot.readI64();
setDeletedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 13: // ACTIVE
if (field.type == TType.BOOL) {
this.active = iprot.readBool();
setActiveIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 14: // SHARD_ID
if (field.type == TType.STRING) {
this.shardId = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 15: // ATTRIBUTES
if (field.type == TType.STRUCT) {
this.attributes = new UserAttributes();
this.attributes.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 16: // ACCOUNTING
if (field.type == TType.STRUCT) {
this.accounting = new Accounting();
this.accounting.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 17: // PREMIUM_INFO
if (field.type == TType.STRUCT) {
this.premiumInfo = new PremiumInfo();
this.premiumInfo.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 18: // BUSINESS_USER_INFO
if (field.type == TType.STRUCT) {
this.businessUserInfo = new BusinessUserInfo();
this.businessUserInfo.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
default:
TProtocolUtil.skip(iprot, field.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (isSetId()) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeI32(this.id);
oprot.writeFieldEnd();
}
if (this.username != null) {
if (isSetUsername()) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(this.username);
oprot.writeFieldEnd();
}
}
if (this.email != null) {
if (isSetEmail()) {
oprot.writeFieldBegin(EMAIL_FIELD_DESC);
oprot.writeString(this.email);
oprot.writeFieldEnd();
}
}
if (this.name != null) {
if (isSetName()) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(this.name);
oprot.writeFieldEnd();
}
}
if (this.timezone != null) {
if (isSetTimezone()) {
oprot.writeFieldBegin(TIMEZONE_FIELD_DESC);
oprot.writeString(this.timezone);
oprot.writeFieldEnd();
}
}
if (this.privilege != null) {
if (isSetPrivilege()) {
oprot.writeFieldBegin(PRIVILEGE_FIELD_DESC);
oprot.writeI32(this.privilege.getValue());
oprot.writeFieldEnd();
}
}
if (isSetCreated()) {
oprot.writeFieldBegin(CREATED_FIELD_DESC);
oprot.writeI64(this.created);
oprot.writeFieldEnd();
}
if (isSetUpdated()) {
oprot.writeFieldBegin(UPDATED_FIELD_DESC);
oprot.writeI64(this.updated);
oprot.writeFieldEnd();
}
if (isSetDeleted()) {
oprot.writeFieldBegin(DELETED_FIELD_DESC);
oprot.writeI64(this.deleted);
oprot.writeFieldEnd();
}
if (isSetActive()) {
oprot.writeFieldBegin(ACTIVE_FIELD_DESC);
oprot.writeBool(this.active);
oprot.writeFieldEnd();
}
if (this.shardId != null) {
if (isSetShardId()) {
oprot.writeFieldBegin(SHARD_ID_FIELD_DESC);
oprot.writeString(this.shardId);
oprot.writeFieldEnd();
}
}
if (this.attributes != null) {
if (isSetAttributes()) {
oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
this.attributes.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.accounting != null) {
if (isSetAccounting()) {
oprot.writeFieldBegin(ACCOUNTING_FIELD_DESC);
this.accounting.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.premiumInfo != null) {
if (isSetPremiumInfo()) {
oprot.writeFieldBegin(PREMIUM_INFO_FIELD_DESC);
this.premiumInfo.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.businessUserInfo != null) {
if (isSetBusinessUserInfo()) {
oprot.writeFieldBegin(BUSINESS_USER_INFO_FIELD_DESC);
this.businessUserInfo.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("User(");
boolean first = true;
if (isSetId()) {
sb.append("id:");
sb.append(this.id);
first = false;
}
if (isSetUsername()) {
if (!first) sb.append(", ");
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
}
if (isSetEmail()) {
if (!first) sb.append(", ");
sb.append("email:");
if (this.email == null) {
sb.append("null");
} else {
sb.append(this.email);
}
first = false;
}
if (isSetName()) {
if (!first) sb.append(", ");
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
}
if (isSetTimezone()) {
if (!first) sb.append(", ");
sb.append("timezone:");
if (this.timezone == null) {
sb.append("null");
} else {
sb.append(this.timezone);
}
first = false;
}
if (isSetPrivilege()) {
if (!first) sb.append(", ");
sb.append("privilege:");
if (this.privilege == null) {
sb.append("null");
} else {
sb.append(this.privilege);
}
first = false;
}
if (isSetCreated()) {
if (!first) sb.append(", ");
sb.append("created:");
sb.append(this.created);
first = false;
}
if (isSetUpdated()) {
if (!first) sb.append(", ");
sb.append("updated:");
sb.append(this.updated);
first = false;
}
if (isSetDeleted()) {
if (!first) sb.append(", ");
sb.append("deleted:");
sb.append(this.deleted);
first = false;
}
if (isSetActive()) {
if (!first) sb.append(", ");
sb.append("active:");
sb.append(this.active);
first = false;
}
if (isSetShardId()) {
if (!first) sb.append(", ");
sb.append("shardId:");
if (this.shardId == null) {
sb.append("null");
} else {
sb.append(this.shardId);
}
first = false;
}
if (isSetAttributes()) {
if (!first) sb.append(", ");
sb.append("attributes:");
if (this.attributes == null) {
sb.append("null");
} else {
sb.append(this.attributes);
}
first = false;
}
if (isSetAccounting()) {
if (!first) sb.append(", ");
sb.append("accounting:");
if (this.accounting == null) {
sb.append("null");
} else {
sb.append(this.accounting);
}
first = false;
}
if (isSetPremiumInfo()) {
if (!first) sb.append(", ");
sb.append("premiumInfo:");
if (this.premiumInfo == null) {
sb.append("null");
} else {
sb.append(this.premiumInfo);
}
first = false;
}
if (isSetBusinessUserInfo()) {
if (!first) sb.append(", ");
sb.append("businessUserInfo:");
if (this.businessUserInfo == null) {
sb.append("null");
} else {
sb.append(this.businessUserInfo);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}