com.evernote.edam.type.Notebook 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.*;
/**
* A unique container for a set of notes.
*
* - guid
* - The unique identifier of this notebook.
*
* Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
*
* Regex: EDAM_GUID_REGEX
*
*
* - name
* - A sequence of characters representing the name of the
* notebook. May be changed by clients, but the account may not contain two
* notebooks with names that are equal via a case-insensitive comparison.
* Can't begin or end with a space.
*
* Length: EDAM_NOTEBOOK_NAME_LEN_MIN - EDAM_NOTEBOOK_NAME_LEN_MAX
*
* Regex: EDAM_NOTEBOOK_NAME_REGEX
*
*
* - updateSequenceNum
* - A number identifying the last transaction to
* modify the state of this object. The USN values are sequential within an
* account, and can be used to compare the order of modifications within the
* service.
*
*
* - defaultNotebook
* - If true, this notebook should be used for new notes
* whenever the user has not (or cannot) specify a desired target notebook.
* For example, if a note is submitted via SMTP email.
* The service will maintain at most one defaultNotebook per account.
* If a second notebook is created or updated with defaultNotebook set to
* true, the service will automatically update the prior notebook's
* defaultNotebook field to false. If the default notebook is deleted
* (i.e. "active" set to false), the "defaultNotebook" field will be
* set to false by the service. If the account has no default notebook
* set, the service will use the most recent notebook as the default.
*
*
* - serviceCreated
* - The time when this notebook was created on the
* service. This will be set on the service during creation, and the service
* will provide this value when it returns a Notebook to a client.
* The service will ignore this value if it is sent by clients.
*
*
* - serviceUpdated
* - The time when this notebook was last modified on the
* service. This will be set on the service during creation, and the service
* will provide this value when it returns a Notebook to a client.
* The service will ignore this value if it is sent by clients.
*
*
* - publishing
* - If the Notebook has been opened for public access, or
* business users shared with their business (i.e. if 'published' is
* set to true), then this will point to the set of publishing
* information for the Notebook (URI, description, etc.). A
* Notebook cannot be published without providing this information,
* but it will persist for later use if publishing is ever disabled
* on the Notebook. Clients that do not wish to change the
* publishing behavior of a Notebook should not set this value when
* calling NoteStore.updateNotebook().
*
*
* - published
* - If this is set to true, then the Notebook will be
* accessible either to the public, or for business users to their business,
* via the 'publishing' specification, which must also be set. If this is set
* to false, the Notebook will not be available to the public (or business).
* Clients that do not wish to change the publishing behavior of a Notebook
* should not set this value when calling NoteStore.updateNotebook().
*
*
* - stack
* - If this is set, then the notebook is visually contained within a stack
* of notebooks with this name. All notebooks in the same account with the
* same 'stack' field are considered to be in the same stack.
* Notebooks with no stack set are "top level" and not contained within a
* stack.
*
*
* - sharedNotebookIds
* - DEPRECATED - replaced by sharedNotebooks.
*
* - sharedNotebooks
* - The list of recipients to whom this notebook has been shared
* (one SharedNotebook object per recipient email address). This field will
* be unset if you do not have permission to access this data. If you are
* accessing the notebook as the owner or via a shared notebook that is
* modifiable, then you have access to this data and the value will be set.
* This field is read-only. Clients may not make changes to shared notebooks
* via this field.
*
*
* - businessNotebook
* - If the notebook is part of a business account and has been published to the
* business library, this will contain information for the library listing.
* The presence or absence of this field is not a reliable test of whether a given
* notebook is in fact a business notebook - the field is only used when a notebook is or
* has been published to the business library.
*
*
* - contact
* - Intended for use with Business accounts, this field identifies the user who
* has been designated as the "contact". For notebooks created in business
* accounts, the server will automatically set this value to the user who created
* the notebook unless Notebook.contact.username has been set, in which that value
* will be used. When updating a notebook, it is common to leave Notebook.contact
* field unset, indicating that no change to the value is being requested and that
* the existing value, if any, should be preserved.
*
*
*
*/
public class Notebook implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("Notebook");
private static final TField GUID_FIELD_DESC = new TField("guid", TType.STRING, (short)1);
private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2);
private static final TField UPDATE_SEQUENCE_NUM_FIELD_DESC = new TField("updateSequenceNum", TType.I32, (short)5);
private static final TField DEFAULT_NOTEBOOK_FIELD_DESC = new TField("defaultNotebook", TType.BOOL, (short)6);
private static final TField SERVICE_CREATED_FIELD_DESC = new TField("serviceCreated", TType.I64, (short)7);
private static final TField SERVICE_UPDATED_FIELD_DESC = new TField("serviceUpdated", TType.I64, (short)8);
private static final TField PUBLISHING_FIELD_DESC = new TField("publishing", TType.STRUCT, (short)10);
private static final TField PUBLISHED_FIELD_DESC = new TField("published", TType.BOOL, (short)11);
private static final TField STACK_FIELD_DESC = new TField("stack", TType.STRING, (short)12);
private static final TField SHARED_NOTEBOOK_IDS_FIELD_DESC = new TField("sharedNotebookIds", TType.LIST, (short)13);
private static final TField SHARED_NOTEBOOKS_FIELD_DESC = new TField("sharedNotebooks", TType.LIST, (short)14);
private static final TField BUSINESS_NOTEBOOK_FIELD_DESC = new TField("businessNotebook", TType.STRUCT, (short)15);
private static final TField CONTACT_FIELD_DESC = new TField("contact", TType.STRUCT, (short)16);
private static final TField RESTRICTIONS_FIELD_DESC = new TField("restrictions", TType.STRUCT, (short)17);
private String guid;
private String name;
private int updateSequenceNum;
private boolean defaultNotebook;
private long serviceCreated;
private long serviceUpdated;
private Publishing publishing;
private boolean published;
private String stack;
private List sharedNotebookIds;
private List sharedNotebooks;
private BusinessNotebook businessNotebook;
private User contact;
private NotebookRestrictions restrictions;
// isset id assignments
private static final int __UPDATESEQUENCENUM_ISSET_ID = 0;
private static final int __DEFAULTNOTEBOOK_ISSET_ID = 1;
private static final int __SERVICECREATED_ISSET_ID = 2;
private static final int __SERVICEUPDATED_ISSET_ID = 3;
private static final int __PUBLISHED_ISSET_ID = 4;
private boolean[] __isset_vector = new boolean[5];
public Notebook() {
}
/**
* Performs a deep copy on other.
*/
public Notebook(Notebook other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
if (other.isSetGuid()) {
this.guid = other.guid;
}
if (other.isSetName()) {
this.name = other.name;
}
this.updateSequenceNum = other.updateSequenceNum;
this.defaultNotebook = other.defaultNotebook;
this.serviceCreated = other.serviceCreated;
this.serviceUpdated = other.serviceUpdated;
if (other.isSetPublishing()) {
this.publishing = new Publishing(other.publishing);
}
this.published = other.published;
if (other.isSetStack()) {
this.stack = other.stack;
}
if (other.isSetSharedNotebookIds()) {
List __this__sharedNotebookIds = new ArrayList();
for (Long other_element : other.sharedNotebookIds) {
__this__sharedNotebookIds.add(other_element);
}
this.sharedNotebookIds = __this__sharedNotebookIds;
}
if (other.isSetSharedNotebooks()) {
List __this__sharedNotebooks = new ArrayList();
for (SharedNotebook other_element : other.sharedNotebooks) {
__this__sharedNotebooks.add(new SharedNotebook(other_element));
}
this.sharedNotebooks = __this__sharedNotebooks;
}
if (other.isSetBusinessNotebook()) {
this.businessNotebook = new BusinessNotebook(other.businessNotebook);
}
if (other.isSetContact()) {
this.contact = new User(other.contact);
}
if (other.isSetRestrictions()) {
this.restrictions = new NotebookRestrictions(other.restrictions);
}
}
public Notebook deepCopy() {
return new Notebook(this);
}
public void clear() {
this.guid = null;
this.name = null;
setUpdateSequenceNumIsSet(false);
this.updateSequenceNum = 0;
setDefaultNotebookIsSet(false);
this.defaultNotebook = false;
setServiceCreatedIsSet(false);
this.serviceCreated = 0;
setServiceUpdatedIsSet(false);
this.serviceUpdated = 0;
this.publishing = null;
setPublishedIsSet(false);
this.published = false;
this.stack = null;
this.sharedNotebookIds = null;
this.sharedNotebooks = null;
this.businessNotebook = null;
this.contact = null;
this.restrictions = null;
}
public String getGuid() {
return this.guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public void unsetGuid() {
this.guid = null;
}
/** Returns true if field guid is set (has been asigned a value) and false otherwise */
public boolean isSetGuid() {
return this.guid != null;
}
public void setGuidIsSet(boolean value) {
if (!value) {
this.guid = 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 int getUpdateSequenceNum() {
return this.updateSequenceNum;
}
public void setUpdateSequenceNum(int updateSequenceNum) {
this.updateSequenceNum = updateSequenceNum;
setUpdateSequenceNumIsSet(true);
}
public void unsetUpdateSequenceNum() {
__isset_vector[__UPDATESEQUENCENUM_ISSET_ID] = false;
}
/** Returns true if field updateSequenceNum is set (has been asigned a value) and false otherwise */
public boolean isSetUpdateSequenceNum() {
return __isset_vector[__UPDATESEQUENCENUM_ISSET_ID];
}
public void setUpdateSequenceNumIsSet(boolean value) {
__isset_vector[__UPDATESEQUENCENUM_ISSET_ID] = value;
}
public boolean isDefaultNotebook() {
return this.defaultNotebook;
}
public void setDefaultNotebook(boolean defaultNotebook) {
this.defaultNotebook = defaultNotebook;
setDefaultNotebookIsSet(true);
}
public void unsetDefaultNotebook() {
__isset_vector[__DEFAULTNOTEBOOK_ISSET_ID] = false;
}
/** Returns true if field defaultNotebook is set (has been asigned a value) and false otherwise */
public boolean isSetDefaultNotebook() {
return __isset_vector[__DEFAULTNOTEBOOK_ISSET_ID];
}
public void setDefaultNotebookIsSet(boolean value) {
__isset_vector[__DEFAULTNOTEBOOK_ISSET_ID] = value;
}
public long getServiceCreated() {
return this.serviceCreated;
}
public void setServiceCreated(long serviceCreated) {
this.serviceCreated = serviceCreated;
setServiceCreatedIsSet(true);
}
public void unsetServiceCreated() {
__isset_vector[__SERVICECREATED_ISSET_ID] = false;
}
/** Returns true if field serviceCreated is set (has been asigned a value) and false otherwise */
public boolean isSetServiceCreated() {
return __isset_vector[__SERVICECREATED_ISSET_ID];
}
public void setServiceCreatedIsSet(boolean value) {
__isset_vector[__SERVICECREATED_ISSET_ID] = value;
}
public long getServiceUpdated() {
return this.serviceUpdated;
}
public void setServiceUpdated(long serviceUpdated) {
this.serviceUpdated = serviceUpdated;
setServiceUpdatedIsSet(true);
}
public void unsetServiceUpdated() {
__isset_vector[__SERVICEUPDATED_ISSET_ID] = false;
}
/** Returns true if field serviceUpdated is set (has been asigned a value) and false otherwise */
public boolean isSetServiceUpdated() {
return __isset_vector[__SERVICEUPDATED_ISSET_ID];
}
public void setServiceUpdatedIsSet(boolean value) {
__isset_vector[__SERVICEUPDATED_ISSET_ID] = value;
}
public Publishing getPublishing() {
return this.publishing;
}
public void setPublishing(Publishing publishing) {
this.publishing = publishing;
}
public void unsetPublishing() {
this.publishing = null;
}
/** Returns true if field publishing is set (has been asigned a value) and false otherwise */
public boolean isSetPublishing() {
return this.publishing != null;
}
public void setPublishingIsSet(boolean value) {
if (!value) {
this.publishing = null;
}
}
public boolean isPublished() {
return this.published;
}
public void setPublished(boolean published) {
this.published = published;
setPublishedIsSet(true);
}
public void unsetPublished() {
__isset_vector[__PUBLISHED_ISSET_ID] = false;
}
/** Returns true if field published is set (has been asigned a value) and false otherwise */
public boolean isSetPublished() {
return __isset_vector[__PUBLISHED_ISSET_ID];
}
public void setPublishedIsSet(boolean value) {
__isset_vector[__PUBLISHED_ISSET_ID] = value;
}
public String getStack() {
return this.stack;
}
public void setStack(String stack) {
this.stack = stack;
}
public void unsetStack() {
this.stack = null;
}
/** Returns true if field stack is set (has been asigned a value) and false otherwise */
public boolean isSetStack() {
return this.stack != null;
}
public void setStackIsSet(boolean value) {
if (!value) {
this.stack = null;
}
}
public int getSharedNotebookIdsSize() {
return (this.sharedNotebookIds == null) ? 0 : this.sharedNotebookIds.size();
}
public java.util.Iterator getSharedNotebookIdsIterator() {
return (this.sharedNotebookIds == null) ? null : this.sharedNotebookIds.iterator();
}
public void addToSharedNotebookIds(long elem) {
if (this.sharedNotebookIds == null) {
this.sharedNotebookIds = new ArrayList();
}
this.sharedNotebookIds.add(elem);
}
public List getSharedNotebookIds() {
return this.sharedNotebookIds;
}
public void setSharedNotebookIds(List sharedNotebookIds) {
this.sharedNotebookIds = sharedNotebookIds;
}
public void unsetSharedNotebookIds() {
this.sharedNotebookIds = null;
}
/** Returns true if field sharedNotebookIds is set (has been asigned a value) and false otherwise */
public boolean isSetSharedNotebookIds() {
return this.sharedNotebookIds != null;
}
public void setSharedNotebookIdsIsSet(boolean value) {
if (!value) {
this.sharedNotebookIds = null;
}
}
public int getSharedNotebooksSize() {
return (this.sharedNotebooks == null) ? 0 : this.sharedNotebooks.size();
}
public java.util.Iterator getSharedNotebooksIterator() {
return (this.sharedNotebooks == null) ? null : this.sharedNotebooks.iterator();
}
public void addToSharedNotebooks(SharedNotebook elem) {
if (this.sharedNotebooks == null) {
this.sharedNotebooks = new ArrayList();
}
this.sharedNotebooks.add(elem);
}
public List getSharedNotebooks() {
return this.sharedNotebooks;
}
public void setSharedNotebooks(List sharedNotebooks) {
this.sharedNotebooks = sharedNotebooks;
}
public void unsetSharedNotebooks() {
this.sharedNotebooks = null;
}
/** Returns true if field sharedNotebooks is set (has been asigned a value) and false otherwise */
public boolean isSetSharedNotebooks() {
return this.sharedNotebooks != null;
}
public void setSharedNotebooksIsSet(boolean value) {
if (!value) {
this.sharedNotebooks = null;
}
}
public BusinessNotebook getBusinessNotebook() {
return this.businessNotebook;
}
public void setBusinessNotebook(BusinessNotebook businessNotebook) {
this.businessNotebook = businessNotebook;
}
public void unsetBusinessNotebook() {
this.businessNotebook = null;
}
/** Returns true if field businessNotebook is set (has been asigned a value) and false otherwise */
public boolean isSetBusinessNotebook() {
return this.businessNotebook != null;
}
public void setBusinessNotebookIsSet(boolean value) {
if (!value) {
this.businessNotebook = null;
}
}
public User getContact() {
return this.contact;
}
public void setContact(User contact) {
this.contact = contact;
}
public void unsetContact() {
this.contact = null;
}
/** Returns true if field contact is set (has been asigned a value) and false otherwise */
public boolean isSetContact() {
return this.contact != null;
}
public void setContactIsSet(boolean value) {
if (!value) {
this.contact = null;
}
}
public NotebookRestrictions getRestrictions() {
return this.restrictions;
}
public void setRestrictions(NotebookRestrictions restrictions) {
this.restrictions = restrictions;
}
public void unsetRestrictions() {
this.restrictions = null;
}
/** Returns true if field restrictions is set (has been asigned a value) and false otherwise */
public boolean isSetRestrictions() {
return this.restrictions != null;
}
public void setRestrictionsIsSet(boolean value) {
if (!value) {
this.restrictions = null;
}
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Notebook)
return this.equals((Notebook)that);
return false;
}
public boolean equals(Notebook that) {
if (that == null)
return false;
boolean this_present_guid = true && this.isSetGuid();
boolean that_present_guid = true && that.isSetGuid();
if (this_present_guid || that_present_guid) {
if (!(this_present_guid && that_present_guid))
return false;
if (!this.guid.equals(that.guid))
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_updateSequenceNum = true && this.isSetUpdateSequenceNum();
boolean that_present_updateSequenceNum = true && that.isSetUpdateSequenceNum();
if (this_present_updateSequenceNum || that_present_updateSequenceNum) {
if (!(this_present_updateSequenceNum && that_present_updateSequenceNum))
return false;
if (this.updateSequenceNum != that.updateSequenceNum)
return false;
}
boolean this_present_defaultNotebook = true && this.isSetDefaultNotebook();
boolean that_present_defaultNotebook = true && that.isSetDefaultNotebook();
if (this_present_defaultNotebook || that_present_defaultNotebook) {
if (!(this_present_defaultNotebook && that_present_defaultNotebook))
return false;
if (this.defaultNotebook != that.defaultNotebook)
return false;
}
boolean this_present_serviceCreated = true && this.isSetServiceCreated();
boolean that_present_serviceCreated = true && that.isSetServiceCreated();
if (this_present_serviceCreated || that_present_serviceCreated) {
if (!(this_present_serviceCreated && that_present_serviceCreated))
return false;
if (this.serviceCreated != that.serviceCreated)
return false;
}
boolean this_present_serviceUpdated = true && this.isSetServiceUpdated();
boolean that_present_serviceUpdated = true && that.isSetServiceUpdated();
if (this_present_serviceUpdated || that_present_serviceUpdated) {
if (!(this_present_serviceUpdated && that_present_serviceUpdated))
return false;
if (this.serviceUpdated != that.serviceUpdated)
return false;
}
boolean this_present_publishing = true && this.isSetPublishing();
boolean that_present_publishing = true && that.isSetPublishing();
if (this_present_publishing || that_present_publishing) {
if (!(this_present_publishing && that_present_publishing))
return false;
if (!this.publishing.equals(that.publishing))
return false;
}
boolean this_present_published = true && this.isSetPublished();
boolean that_present_published = true && that.isSetPublished();
if (this_present_published || that_present_published) {
if (!(this_present_published && that_present_published))
return false;
if (this.published != that.published)
return false;
}
boolean this_present_stack = true && this.isSetStack();
boolean that_present_stack = true && that.isSetStack();
if (this_present_stack || that_present_stack) {
if (!(this_present_stack && that_present_stack))
return false;
if (!this.stack.equals(that.stack))
return false;
}
boolean this_present_sharedNotebookIds = true && this.isSetSharedNotebookIds();
boolean that_present_sharedNotebookIds = true && that.isSetSharedNotebookIds();
if (this_present_sharedNotebookIds || that_present_sharedNotebookIds) {
if (!(this_present_sharedNotebookIds && that_present_sharedNotebookIds))
return false;
if (!this.sharedNotebookIds.equals(that.sharedNotebookIds))
return false;
}
boolean this_present_sharedNotebooks = true && this.isSetSharedNotebooks();
boolean that_present_sharedNotebooks = true && that.isSetSharedNotebooks();
if (this_present_sharedNotebooks || that_present_sharedNotebooks) {
if (!(this_present_sharedNotebooks && that_present_sharedNotebooks))
return false;
if (!this.sharedNotebooks.equals(that.sharedNotebooks))
return false;
}
boolean this_present_businessNotebook = true && this.isSetBusinessNotebook();
boolean that_present_businessNotebook = true && that.isSetBusinessNotebook();
if (this_present_businessNotebook || that_present_businessNotebook) {
if (!(this_present_businessNotebook && that_present_businessNotebook))
return false;
if (!this.businessNotebook.equals(that.businessNotebook))
return false;
}
boolean this_present_contact = true && this.isSetContact();
boolean that_present_contact = true && that.isSetContact();
if (this_present_contact || that_present_contact) {
if (!(this_present_contact && that_present_contact))
return false;
if (!this.contact.equals(that.contact))
return false;
}
boolean this_present_restrictions = true && this.isSetRestrictions();
boolean that_present_restrictions = true && that.isSetRestrictions();
if (this_present_restrictions || that_present_restrictions) {
if (!(this_present_restrictions && that_present_restrictions))
return false;
if (!this.restrictions.equals(that.restrictions))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(Notebook other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
Notebook typedOther = (Notebook)other;
lastComparison = Boolean.valueOf(isSetGuid()).compareTo(typedOther.isSetGuid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGuid()) { lastComparison = TBaseHelper.compareTo(this.guid, typedOther.guid);
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(isSetUpdateSequenceNum()).compareTo(typedOther.isSetUpdateSequenceNum());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUpdateSequenceNum()) { lastComparison = TBaseHelper.compareTo(this.updateSequenceNum, typedOther.updateSequenceNum);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetDefaultNotebook()).compareTo(typedOther.isSetDefaultNotebook());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDefaultNotebook()) { lastComparison = TBaseHelper.compareTo(this.defaultNotebook, typedOther.defaultNotebook);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetServiceCreated()).compareTo(typedOther.isSetServiceCreated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceCreated()) { lastComparison = TBaseHelper.compareTo(this.serviceCreated, typedOther.serviceCreated);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetServiceUpdated()).compareTo(typedOther.isSetServiceUpdated());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceUpdated()) { lastComparison = TBaseHelper.compareTo(this.serviceUpdated, typedOther.serviceUpdated);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPublishing()).compareTo(typedOther.isSetPublishing());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPublishing()) { lastComparison = TBaseHelper.compareTo(this.publishing, typedOther.publishing);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPublished()).compareTo(typedOther.isSetPublished());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPublished()) { lastComparison = TBaseHelper.compareTo(this.published, typedOther.published);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStack()).compareTo(typedOther.isSetStack());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStack()) { lastComparison = TBaseHelper.compareTo(this.stack, typedOther.stack);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSharedNotebookIds()).compareTo(typedOther.isSetSharedNotebookIds());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSharedNotebookIds()) { lastComparison = TBaseHelper.compareTo(this.sharedNotebookIds, typedOther.sharedNotebookIds);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetSharedNotebooks()).compareTo(typedOther.isSetSharedNotebooks());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSharedNotebooks()) { lastComparison = TBaseHelper.compareTo(this.sharedNotebooks, typedOther.sharedNotebooks);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBusinessNotebook()).compareTo(typedOther.isSetBusinessNotebook());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBusinessNotebook()) { lastComparison = TBaseHelper.compareTo(this.businessNotebook, typedOther.businessNotebook);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetContact()).compareTo(typedOther.isSetContact());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetContact()) { lastComparison = TBaseHelper.compareTo(this.contact, typedOther.contact);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRestrictions()).compareTo(typedOther.isSetRestrictions());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRestrictions()) { lastComparison = TBaseHelper.compareTo(this.restrictions, typedOther.restrictions);
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: // GUID
if (field.type == TType.STRING) {
this.guid = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // NAME
if (field.type == TType.STRING) {
this.name = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // UPDATE_SEQUENCE_NUM
if (field.type == TType.I32) {
this.updateSequenceNum = iprot.readI32();
setUpdateSequenceNumIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // DEFAULT_NOTEBOOK
if (field.type == TType.BOOL) {
this.defaultNotebook = iprot.readBool();
setDefaultNotebookIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // SERVICE_CREATED
if (field.type == TType.I64) {
this.serviceCreated = iprot.readI64();
setServiceCreatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 8: // SERVICE_UPDATED
if (field.type == TType.I64) {
this.serviceUpdated = iprot.readI64();
setServiceUpdatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 10: // PUBLISHING
if (field.type == TType.STRUCT) {
this.publishing = new Publishing();
this.publishing.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 11: // PUBLISHED
if (field.type == TType.BOOL) {
this.published = iprot.readBool();
setPublishedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 12: // STACK
if (field.type == TType.STRING) {
this.stack = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 13: // SHARED_NOTEBOOK_IDS
if (field.type == TType.LIST) {
{
TList _list34 = iprot.readListBegin();
this.sharedNotebookIds = new ArrayList(_list34.size);
for (int _i35 = 0; _i35 < _list34.size; ++_i35)
{
long _elem36;
_elem36 = iprot.readI64();
this.sharedNotebookIds.add(_elem36);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 14: // SHARED_NOTEBOOKS
if (field.type == TType.LIST) {
{
TList _list37 = iprot.readListBegin();
this.sharedNotebooks = new ArrayList(_list37.size);
for (int _i38 = 0; _i38 < _list37.size; ++_i38)
{
SharedNotebook _elem39;
_elem39 = new SharedNotebook();
_elem39.read(iprot);
this.sharedNotebooks.add(_elem39);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 15: // BUSINESS_NOTEBOOK
if (field.type == TType.STRUCT) {
this.businessNotebook = new BusinessNotebook();
this.businessNotebook.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 16: // CONTACT
if (field.type == TType.STRUCT) {
this.contact = new User();
this.contact.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 17: // RESTRICTIONS
if (field.type == TType.STRUCT) {
this.restrictions = new NotebookRestrictions();
this.restrictions.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 (this.guid != null) {
if (isSetGuid()) {
oprot.writeFieldBegin(GUID_FIELD_DESC);
oprot.writeString(this.guid);
oprot.writeFieldEnd();
}
}
if (this.name != null) {
if (isSetName()) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(this.name);
oprot.writeFieldEnd();
}
}
if (isSetUpdateSequenceNum()) {
oprot.writeFieldBegin(UPDATE_SEQUENCE_NUM_FIELD_DESC);
oprot.writeI32(this.updateSequenceNum);
oprot.writeFieldEnd();
}
if (isSetDefaultNotebook()) {
oprot.writeFieldBegin(DEFAULT_NOTEBOOK_FIELD_DESC);
oprot.writeBool(this.defaultNotebook);
oprot.writeFieldEnd();
}
if (isSetServiceCreated()) {
oprot.writeFieldBegin(SERVICE_CREATED_FIELD_DESC);
oprot.writeI64(this.serviceCreated);
oprot.writeFieldEnd();
}
if (isSetServiceUpdated()) {
oprot.writeFieldBegin(SERVICE_UPDATED_FIELD_DESC);
oprot.writeI64(this.serviceUpdated);
oprot.writeFieldEnd();
}
if (this.publishing != null) {
if (isSetPublishing()) {
oprot.writeFieldBegin(PUBLISHING_FIELD_DESC);
this.publishing.write(oprot);
oprot.writeFieldEnd();
}
}
if (isSetPublished()) {
oprot.writeFieldBegin(PUBLISHED_FIELD_DESC);
oprot.writeBool(this.published);
oprot.writeFieldEnd();
}
if (this.stack != null) {
if (isSetStack()) {
oprot.writeFieldBegin(STACK_FIELD_DESC);
oprot.writeString(this.stack);
oprot.writeFieldEnd();
}
}
if (this.sharedNotebookIds != null) {
if (isSetSharedNotebookIds()) {
oprot.writeFieldBegin(SHARED_NOTEBOOK_IDS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.I64, this.sharedNotebookIds.size()));
for (long _iter40 : this.sharedNotebookIds)
{
oprot.writeI64(_iter40);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.sharedNotebooks != null) {
if (isSetSharedNotebooks()) {
oprot.writeFieldBegin(SHARED_NOTEBOOKS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.sharedNotebooks.size()));
for (SharedNotebook _iter41 : this.sharedNotebooks)
{
_iter41.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.businessNotebook != null) {
if (isSetBusinessNotebook()) {
oprot.writeFieldBegin(BUSINESS_NOTEBOOK_FIELD_DESC);
this.businessNotebook.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.contact != null) {
if (isSetContact()) {
oprot.writeFieldBegin(CONTACT_FIELD_DESC);
this.contact.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.restrictions != null) {
if (isSetRestrictions()) {
oprot.writeFieldBegin(RESTRICTIONS_FIELD_DESC);
this.restrictions.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Notebook(");
boolean first = true;
if (isSetGuid()) {
sb.append("guid:");
if (this.guid == null) {
sb.append("null");
} else {
sb.append(this.guid);
}
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 (isSetUpdateSequenceNum()) {
if (!first) sb.append(", ");
sb.append("updateSequenceNum:");
sb.append(this.updateSequenceNum);
first = false;
}
if (isSetDefaultNotebook()) {
if (!first) sb.append(", ");
sb.append("defaultNotebook:");
sb.append(this.defaultNotebook);
first = false;
}
if (isSetServiceCreated()) {
if (!first) sb.append(", ");
sb.append("serviceCreated:");
sb.append(this.serviceCreated);
first = false;
}
if (isSetServiceUpdated()) {
if (!first) sb.append(", ");
sb.append("serviceUpdated:");
sb.append(this.serviceUpdated);
first = false;
}
if (isSetPublishing()) {
if (!first) sb.append(", ");
sb.append("publishing:");
if (this.publishing == null) {
sb.append("null");
} else {
sb.append(this.publishing);
}
first = false;
}
if (isSetPublished()) {
if (!first) sb.append(", ");
sb.append("published:");
sb.append(this.published);
first = false;
}
if (isSetStack()) {
if (!first) sb.append(", ");
sb.append("stack:");
if (this.stack == null) {
sb.append("null");
} else {
sb.append(this.stack);
}
first = false;
}
if (isSetSharedNotebookIds()) {
if (!first) sb.append(", ");
sb.append("sharedNotebookIds:");
if (this.sharedNotebookIds == null) {
sb.append("null");
} else {
sb.append(this.sharedNotebookIds);
}
first = false;
}
if (isSetSharedNotebooks()) {
if (!first) sb.append(", ");
sb.append("sharedNotebooks:");
if (this.sharedNotebooks == null) {
sb.append("null");
} else {
sb.append(this.sharedNotebooks);
}
first = false;
}
if (isSetBusinessNotebook()) {
if (!first) sb.append(", ");
sb.append("businessNotebook:");
if (this.businessNotebook == null) {
sb.append("null");
} else {
sb.append(this.businessNotebook);
}
first = false;
}
if (isSetContact()) {
if (!first) sb.append(", ");
sb.append("contact:");
if (this.contact == null) {
sb.append("null");
} else {
sb.append(this.contact);
}
first = false;
}
if (isSetRestrictions()) {
if (!first) sb.append(", ");
sb.append("restrictions:");
if (this.restrictions == null) {
sb.append("null");
} else {
sb.append(this.restrictions);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}