com.evernote.edam.type.Note 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.*;
/**
* Represents a single note in the user's account.
*
*
* - guid
* - The unique identifier of this note. Will be set by the
* server, but will be omitted by clients calling NoteStore.createNote()
*
* Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
*
* Regex: EDAM_GUID_REGEX
*
*
* - title
* - The subject of the note. Can't begin or end with a space.
*
* Length: EDAM_NOTE_TITLE_LEN_MIN - EDAM_NOTE_TITLE_LEN_MAX
*
* Regex: EDAM_NOTE_TITLE_REGEX
*
*
* - content
* - The XHTML block that makes up the note. This is
* the canonical form of the note's contents, so will include abstract
* Evernote tags for internal resource references. A client may create
* a separate transformed version of this content for internal presentation,
* but the same canonical bytes should be used for transmission and
* comparison unless the user chooses to modify their content.
*
* Length: EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX
*
*
* - contentHash
* - The binary MD5 checksum of the UTF-8 encoded content
* body. This will always be set by the server, but clients may choose to omit
* this when they submit a note with content.
*
* Length: EDAM_HASH_LEN (exactly)
*
*
* - contentLength
* - The number of Unicode characters in the content of
* the note. This will always be set by the service, but clients may choose
* to omit this value when they submit a Note.
*
*
* - created
* - The date and time when the note was created in one of the
* clients. In most cases, this will match the user's sense of when
* the note was created, and ordering between notes will be based on
* ordering of this field. However, this is not a "reliable" timestamp
* if a client has an incorrect clock, so it cannot provide a true absolute
* ordering between notes. Notes created directly through the service
* (e.g. via the web GUI) will have an absolutely ordered "created" value.
*
*
* - updated
* - The date and time when the note was last modified in one of
* the clients. In most cases, this will match the user's sense of when
* the note was modified, but this field may not be absolutely reliable
* due to the possibility of client clock errors.
*
*
* - deleted
* - If present, the note is considered "deleted", and this
* stores the date and time when the note was deleted by one of the clients.
* In most cases, this will match the user's sense of when the note was
* deleted, but this field may be unreliable due to the possibility of
* client clock errors.
*
*
* - active
* - If the note is available for normal actions and viewing,
* this flag will be set to true.
*
*
* - updateSequenceNum
* - A number identifying the last transaction to
* modify the state of this note (including changes to the note's attributes
* or resources). The USN values are sequential within an account,
* and can be used to compare the order of modifications within the service.
*
*
* - notebookGuid
* - The unique identifier of the notebook that contains
* this note. If no notebookGuid is provided on a call to createNote(), the
* default notebook will be used instead.
*
* Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX
*
* Regex: EDAM_GUID_REGEX
*
*
* - tagGuids
* - A list of the GUID identifiers for tags that are applied to this note.
* This may be provided in a call to createNote() to unambiguously declare
* the tags that should be assigned to the new note. Alternately, clients
* may pass the names of desired tags via the 'tagNames' field during
* note creation.
* If the list of tags are omitted on a call to createNote(), then
* the server will assume that no changes have been made to the resources.
* Maximum: EDAM_NOTE_TAGS_MAX tags per note
*
*
* - resources
* - The list of resources that are embedded within this note.
* If the list of resources are omitted on a call to updateNote(), then
* the server will assume that no changes have been made to the resources.
* The binary contents of the resources must be provided when the resource
* is first sent to the service, but it will be omitted by the service when
* the Note is returned in the future.
* Maximum: EDAM_NOTE_RESOURCES_MAX resources per note
*
*
* - attributes
* - A list of the attributes for this note.
* If the list of attributes are omitted on a call to updateNote(), then
* the server will assume that no changes have been made to the resources.
*
*
* - tagNames
* - May be provided by clients during calls to createNote() as an
* alternative to providing the tagGuids of existing tags. If any tagNames
* are provided during createNote(), these will be found, or created if they
* don't already exist. Created tags will have no parent (they will be at
* the top level of the tag panel).
*
*
*/
public class Note implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("Note");
private static final TField GUID_FIELD_DESC = new TField("guid", TType.STRING, (short)1);
private static final TField TITLE_FIELD_DESC = new TField("title", TType.STRING, (short)2);
private static final TField CONTENT_FIELD_DESC = new TField("content", TType.STRING, (short)3);
private static final TField CONTENT_HASH_FIELD_DESC = new TField("contentHash", TType.STRING, (short)4);
private static final TField CONTENT_LENGTH_FIELD_DESC = new TField("contentLength", TType.I32, (short)5);
private static final TField CREATED_FIELD_DESC = new TField("created", TType.I64, (short)6);
private static final TField UPDATED_FIELD_DESC = new TField("updated", TType.I64, (short)7);
private static final TField DELETED_FIELD_DESC = new TField("deleted", TType.I64, (short)8);
private static final TField ACTIVE_FIELD_DESC = new TField("active", TType.BOOL, (short)9);
private static final TField UPDATE_SEQUENCE_NUM_FIELD_DESC = new TField("updateSequenceNum", TType.I32, (short)10);
private static final TField NOTEBOOK_GUID_FIELD_DESC = new TField("notebookGuid", TType.STRING, (short)11);
private static final TField TAG_GUIDS_FIELD_DESC = new TField("tagGuids", TType.LIST, (short)12);
private static final TField RESOURCES_FIELD_DESC = new TField("resources", TType.LIST, (short)13);
private static final TField ATTRIBUTES_FIELD_DESC = new TField("attributes", TType.STRUCT, (short)14);
private static final TField TAG_NAMES_FIELD_DESC = new TField("tagNames", TType.LIST, (short)15);
private String guid;
private String title;
private String content;
private byte[] contentHash;
private int contentLength;
private long created;
private long updated;
private long deleted;
private boolean active;
private int updateSequenceNum;
private String notebookGuid;
private List tagGuids;
private List resources;
private NoteAttributes attributes;
private List tagNames;
// isset id assignments
private static final int __CONTENTLENGTH_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 static final int __UPDATESEQUENCENUM_ISSET_ID = 5;
private boolean[] __isset_vector = new boolean[6];
public Note() {
}
/**
* Performs a deep copy on other.
*/
public Note(Note other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
if (other.isSetGuid()) {
this.guid = other.guid;
}
if (other.isSetTitle()) {
this.title = other.title;
}
if (other.isSetContent()) {
this.content = other.content;
}
if (other.isSetContentHash()) {
this.contentHash = new byte[other.contentHash.length];
System.arraycopy(other.contentHash, 0, contentHash, 0, other.contentHash.length);
}
this.contentLength = other.contentLength;
this.created = other.created;
this.updated = other.updated;
this.deleted = other.deleted;
this.active = other.active;
this.updateSequenceNum = other.updateSequenceNum;
if (other.isSetNotebookGuid()) {
this.notebookGuid = other.notebookGuid;
}
if (other.isSetTagGuids()) {
List __this__tagGuids = new ArrayList();
for (String other_element : other.tagGuids) {
__this__tagGuids.add(other_element);
}
this.tagGuids = __this__tagGuids;
}
if (other.isSetResources()) {
List __this__resources = new ArrayList();
for (Resource other_element : other.resources) {
__this__resources.add(new Resource(other_element));
}
this.resources = __this__resources;
}
if (other.isSetAttributes()) {
this.attributes = new NoteAttributes(other.attributes);
}
if (other.isSetTagNames()) {
List __this__tagNames = new ArrayList();
for (String other_element : other.tagNames) {
__this__tagNames.add(other_element);
}
this.tagNames = __this__tagNames;
}
}
public Note deepCopy() {
return new Note(this);
}
public void clear() {
this.guid = null;
this.title = null;
this.content = null;
this.contentHash = null;
setContentLengthIsSet(false);
this.contentLength = 0;
setCreatedIsSet(false);
this.created = 0;
setUpdatedIsSet(false);
this.updated = 0;
setDeletedIsSet(false);
this.deleted = 0;
setActiveIsSet(false);
this.active = false;
setUpdateSequenceNumIsSet(false);
this.updateSequenceNum = 0;
this.notebookGuid = null;
this.tagGuids = null;
this.resources = null;
this.attributes = null;
this.tagNames = 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 getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public void unsetTitle() {
this.title = null;
}
/** Returns true if field title is set (has been asigned a value) and false otherwise */
public boolean isSetTitle() {
return this.title != null;
}
public void setTitleIsSet(boolean value) {
if (!value) {
this.title = null;
}
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public void unsetContent() {
this.content = null;
}
/** Returns true if field content is set (has been asigned a value) and false otherwise */
public boolean isSetContent() {
return this.content != null;
}
public void setContentIsSet(boolean value) {
if (!value) {
this.content = null;
}
}
public byte[] getContentHash() {
return this.contentHash;
}
public void setContentHash(byte[] contentHash) {
this.contentHash = contentHash;
}
public void unsetContentHash() {
this.contentHash = null;
}
/** Returns true if field contentHash is set (has been asigned a value) and false otherwise */
public boolean isSetContentHash() {
return this.contentHash != null;
}
public void setContentHashIsSet(boolean value) {
if (!value) {
this.contentHash = null;
}
}
public int getContentLength() {
return this.contentLength;
}
public void setContentLength(int contentLength) {
this.contentLength = contentLength;
setContentLengthIsSet(true);
}
public void unsetContentLength() {
__isset_vector[__CONTENTLENGTH_ISSET_ID] = false;
}
/** Returns true if field contentLength is set (has been asigned a value) and false otherwise */
public boolean isSetContentLength() {
return __isset_vector[__CONTENTLENGTH_ISSET_ID];
}
public void setContentLengthIsSet(boolean value) {
__isset_vector[__CONTENTLENGTH_ISSET_ID] = value;
}
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 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 String getNotebookGuid() {
return this.notebookGuid;
}
public void setNotebookGuid(String notebookGuid) {
this.notebookGuid = notebookGuid;
}
public void unsetNotebookGuid() {
this.notebookGuid = null;
}
/** Returns true if field notebookGuid is set (has been asigned a value) and false otherwise */
public boolean isSetNotebookGuid() {
return this.notebookGuid != null;
}
public void setNotebookGuidIsSet(boolean value) {
if (!value) {
this.notebookGuid = null;
}
}
public int getTagGuidsSize() {
return (this.tagGuids == null) ? 0 : this.tagGuids.size();
}
public java.util.Iterator getTagGuidsIterator() {
return (this.tagGuids == null) ? null : this.tagGuids.iterator();
}
public void addToTagGuids(String elem) {
if (this.tagGuids == null) {
this.tagGuids = new ArrayList();
}
this.tagGuids.add(elem);
}
public List getTagGuids() {
return this.tagGuids;
}
public void setTagGuids(List tagGuids) {
this.tagGuids = tagGuids;
}
public void unsetTagGuids() {
this.tagGuids = null;
}
/** Returns true if field tagGuids is set (has been asigned a value) and false otherwise */
public boolean isSetTagGuids() {
return this.tagGuids != null;
}
public void setTagGuidsIsSet(boolean value) {
if (!value) {
this.tagGuids = null;
}
}
public int getResourcesSize() {
return (this.resources == null) ? 0 : this.resources.size();
}
public java.util.Iterator getResourcesIterator() {
return (this.resources == null) ? null : this.resources.iterator();
}
public void addToResources(Resource elem) {
if (this.resources == null) {
this.resources = new ArrayList();
}
this.resources.add(elem);
}
public List getResources() {
return this.resources;
}
public void setResources(List resources) {
this.resources = resources;
}
public void unsetResources() {
this.resources = null;
}
/** Returns true if field resources is set (has been asigned a value) and false otherwise */
public boolean isSetResources() {
return this.resources != null;
}
public void setResourcesIsSet(boolean value) {
if (!value) {
this.resources = null;
}
}
public NoteAttributes getAttributes() {
return this.attributes;
}
public void setAttributes(NoteAttributes 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 int getTagNamesSize() {
return (this.tagNames == null) ? 0 : this.tagNames.size();
}
public java.util.Iterator getTagNamesIterator() {
return (this.tagNames == null) ? null : this.tagNames.iterator();
}
public void addToTagNames(String elem) {
if (this.tagNames == null) {
this.tagNames = new ArrayList();
}
this.tagNames.add(elem);
}
public List getTagNames() {
return this.tagNames;
}
public void setTagNames(List tagNames) {
this.tagNames = tagNames;
}
public void unsetTagNames() {
this.tagNames = null;
}
/** Returns true if field tagNames is set (has been asigned a value) and false otherwise */
public boolean isSetTagNames() {
return this.tagNames != null;
}
public void setTagNamesIsSet(boolean value) {
if (!value) {
this.tagNames = null;
}
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Note)
return this.equals((Note)that);
return false;
}
public boolean equals(Note 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_title = true && this.isSetTitle();
boolean that_present_title = true && that.isSetTitle();
if (this_present_title || that_present_title) {
if (!(this_present_title && that_present_title))
return false;
if (!this.title.equals(that.title))
return false;
}
boolean this_present_content = true && this.isSetContent();
boolean that_present_content = true && that.isSetContent();
if (this_present_content || that_present_content) {
if (!(this_present_content && that_present_content))
return false;
if (!this.content.equals(that.content))
return false;
}
boolean this_present_contentHash = true && this.isSetContentHash();
boolean that_present_contentHash = true && that.isSetContentHash();
if (this_present_contentHash || that_present_contentHash) {
if (!(this_present_contentHash && that_present_contentHash))
return false;
if (TBaseHelper.compareTo(this.contentHash, that.contentHash) != 0)
return false;
}
boolean this_present_contentLength = true && this.isSetContentLength();
boolean that_present_contentLength = true && that.isSetContentLength();
if (this_present_contentLength || that_present_contentLength) {
if (!(this_present_contentLength && that_present_contentLength))
return false;
if (this.contentLength != that.contentLength)
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_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_notebookGuid = true && this.isSetNotebookGuid();
boolean that_present_notebookGuid = true && that.isSetNotebookGuid();
if (this_present_notebookGuid || that_present_notebookGuid) {
if (!(this_present_notebookGuid && that_present_notebookGuid))
return false;
if (!this.notebookGuid.equals(that.notebookGuid))
return false;
}
boolean this_present_tagGuids = true && this.isSetTagGuids();
boolean that_present_tagGuids = true && that.isSetTagGuids();
if (this_present_tagGuids || that_present_tagGuids) {
if (!(this_present_tagGuids && that_present_tagGuids))
return false;
if (!this.tagGuids.equals(that.tagGuids))
return false;
}
boolean this_present_resources = true && this.isSetResources();
boolean that_present_resources = true && that.isSetResources();
if (this_present_resources || that_present_resources) {
if (!(this_present_resources && that_present_resources))
return false;
if (!this.resources.equals(that.resources))
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_tagNames = true && this.isSetTagNames();
boolean that_present_tagNames = true && that.isSetTagNames();
if (this_present_tagNames || that_present_tagNames) {
if (!(this_present_tagNames && that_present_tagNames))
return false;
if (!this.tagNames.equals(that.tagNames))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(Note other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
Note typedOther = (Note)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(isSetTitle()).compareTo(typedOther.isSetTitle());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTitle()) { lastComparison = TBaseHelper.compareTo(this.title, typedOther.title);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetContent()).compareTo(typedOther.isSetContent());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetContent()) { lastComparison = TBaseHelper.compareTo(this.content, typedOther.content);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetContentHash()).compareTo(typedOther.isSetContentHash());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetContentHash()) { lastComparison = TBaseHelper.compareTo(this.contentHash, typedOther.contentHash);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetContentLength()).compareTo(typedOther.isSetContentLength());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetContentLength()) { lastComparison = TBaseHelper.compareTo(this.contentLength, typedOther.contentLength);
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(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(isSetNotebookGuid()).compareTo(typedOther.isSetNotebookGuid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNotebookGuid()) { lastComparison = TBaseHelper.compareTo(this.notebookGuid, typedOther.notebookGuid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTagGuids()).compareTo(typedOther.isSetTagGuids());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTagGuids()) { lastComparison = TBaseHelper.compareTo(this.tagGuids, typedOther.tagGuids);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetResources()).compareTo(typedOther.isSetResources());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetResources()) { lastComparison = TBaseHelper.compareTo(this.resources, typedOther.resources);
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(isSetTagNames()).compareTo(typedOther.isSetTagNames());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTagNames()) { lastComparison = TBaseHelper.compareTo(this.tagNames, typedOther.tagNames);
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: // TITLE
if (field.type == TType.STRING) {
this.title = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // CONTENT
if (field.type == TType.STRING) {
this.content = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // CONTENT_HASH
if (field.type == TType.STRING) {
this.contentHash = iprot.readBytes();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // CONTENT_LENGTH
if (field.type == TType.I32) {
this.contentLength = iprot.readI32();
setContentLengthIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 6: // CREATED
if (field.type == TType.I64) {
this.created = iprot.readI64();
setCreatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 7: // UPDATED
if (field.type == TType.I64) {
this.updated = iprot.readI64();
setUpdatedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 8: // DELETED
if (field.type == TType.I64) {
this.deleted = iprot.readI64();
setDeletedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 9: // ACTIVE
if (field.type == TType.BOOL) {
this.active = iprot.readBool();
setActiveIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 10: // UPDATE_SEQUENCE_NUM
if (field.type == TType.I32) {
this.updateSequenceNum = iprot.readI32();
setUpdateSequenceNumIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 11: // NOTEBOOK_GUID
if (field.type == TType.STRING) {
this.notebookGuid = iprot.readString();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 12: // TAG_GUIDS
if (field.type == TType.LIST) {
{
TList _list22 = iprot.readListBegin();
this.tagGuids = new ArrayList(_list22.size);
for (int _i23 = 0; _i23 < _list22.size; ++_i23)
{
String _elem24;
_elem24 = iprot.readString();
this.tagGuids.add(_elem24);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 13: // RESOURCES
if (field.type == TType.LIST) {
{
TList _list25 = iprot.readListBegin();
this.resources = new ArrayList(_list25.size);
for (int _i26 = 0; _i26 < _list25.size; ++_i26)
{
Resource _elem27;
_elem27 = new Resource();
_elem27.read(iprot);
this.resources.add(_elem27);
}
iprot.readListEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 14: // ATTRIBUTES
if (field.type == TType.STRUCT) {
this.attributes = new NoteAttributes();
this.attributes.read(iprot);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 15: // TAG_NAMES
if (field.type == TType.LIST) {
{
TList _list28 = iprot.readListBegin();
this.tagNames = new ArrayList(_list28.size);
for (int _i29 = 0; _i29 < _list28.size; ++_i29)
{
String _elem30;
_elem30 = iprot.readString();
this.tagNames.add(_elem30);
}
iprot.readListEnd();
}
} 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.title != null) {
if (isSetTitle()) {
oprot.writeFieldBegin(TITLE_FIELD_DESC);
oprot.writeString(this.title);
oprot.writeFieldEnd();
}
}
if (this.content != null) {
if (isSetContent()) {
oprot.writeFieldBegin(CONTENT_FIELD_DESC);
oprot.writeString(this.content);
oprot.writeFieldEnd();
}
}
if (this.contentHash != null) {
if (isSetContentHash()) {
oprot.writeFieldBegin(CONTENT_HASH_FIELD_DESC);
oprot.writeBinary(this.contentHash);
oprot.writeFieldEnd();
}
}
if (isSetContentLength()) {
oprot.writeFieldBegin(CONTENT_LENGTH_FIELD_DESC);
oprot.writeI32(this.contentLength);
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 (isSetUpdateSequenceNum()) {
oprot.writeFieldBegin(UPDATE_SEQUENCE_NUM_FIELD_DESC);
oprot.writeI32(this.updateSequenceNum);
oprot.writeFieldEnd();
}
if (this.notebookGuid != null) {
if (isSetNotebookGuid()) {
oprot.writeFieldBegin(NOTEBOOK_GUID_FIELD_DESC);
oprot.writeString(this.notebookGuid);
oprot.writeFieldEnd();
}
}
if (this.tagGuids != null) {
if (isSetTagGuids()) {
oprot.writeFieldBegin(TAG_GUIDS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.tagGuids.size()));
for (String _iter31 : this.tagGuids)
{
oprot.writeString(_iter31);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.resources != null) {
if (isSetResources()) {
oprot.writeFieldBegin(RESOURCES_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.resources.size()));
for (Resource _iter32 : this.resources)
{
_iter32.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (this.attributes != null) {
if (isSetAttributes()) {
oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
this.attributes.write(oprot);
oprot.writeFieldEnd();
}
}
if (this.tagNames != null) {
if (isSetTagNames()) {
oprot.writeFieldBegin(TAG_NAMES_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.tagNames.size()));
for (String _iter33 : this.tagNames)
{
oprot.writeString(_iter33);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Note(");
boolean first = true;
if (isSetGuid()) {
sb.append("guid:");
if (this.guid == null) {
sb.append("null");
} else {
sb.append(this.guid);
}
first = false;
}
if (isSetTitle()) {
if (!first) sb.append(", ");
sb.append("title:");
if (this.title == null) {
sb.append("null");
} else {
sb.append(this.title);
}
first = false;
}
if (isSetContent()) {
if (!first) sb.append(", ");
sb.append("content:");
if (this.content == null) {
sb.append("null");
} else {
sb.append(this.content);
}
first = false;
}
if (isSetContentHash()) {
if (!first) sb.append(", ");
sb.append("contentHash:");
if (this.contentHash == null) {
sb.append("null");
} else {
TBaseHelper.toString(this.contentHash, sb);
}
first = false;
}
if (isSetContentLength()) {
if (!first) sb.append(", ");
sb.append("contentLength:");
sb.append(this.contentLength);
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 (isSetUpdateSequenceNum()) {
if (!first) sb.append(", ");
sb.append("updateSequenceNum:");
sb.append(this.updateSequenceNum);
first = false;
}
if (isSetNotebookGuid()) {
if (!first) sb.append(", ");
sb.append("notebookGuid:");
if (this.notebookGuid == null) {
sb.append("null");
} else {
sb.append(this.notebookGuid);
}
first = false;
}
if (isSetTagGuids()) {
if (!first) sb.append(", ");
sb.append("tagGuids:");
if (this.tagGuids == null) {
sb.append("null");
} else {
sb.append(this.tagGuids);
}
first = false;
}
if (isSetResources()) {
if (!first) sb.append(", ");
sb.append("resources:");
if (this.resources == null) {
sb.append("null");
} else {
sb.append(this.resources);
}
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 (isSetTagNames()) {
if (!first) sb.append(", ");
sb.append("tagNames:");
if (this.tagNames == null) {
sb.append("null");
} else {
sb.append(this.tagNames);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}