Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.evernote.edam.notestore;
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 data structure representing the number of notes for each notebook
* and tag with a non-zero set of applicable notes.
*
*
*
notebookCounts
*
* A mapping from the Notebook GUID to the number of
* notes (from some selection) that are in the corresponding notebook.
*
*
*
tagCounts
*
* A mapping from the Tag GUID to the number of notes (from some
* selection) that have the corresponding tag.
*
*
*
trashCount
*
* If this is set, then this is the number of notes that are in the trash.
* If this is not set, then the number of notes in the trash hasn't been
* reported. (I.e. if there are no notes in the trash, this will be set
* to 0.)
*
*
*/
public class NoteCollectionCounts implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("NoteCollectionCounts");
private static final TField NOTEBOOK_COUNTS_FIELD_DESC = new TField("notebookCounts", TType.MAP, (short)1);
private static final TField TAG_COUNTS_FIELD_DESC = new TField("tagCounts", TType.MAP, (short)2);
private static final TField TRASH_COUNT_FIELD_DESC = new TField("trashCount", TType.I32, (short)3);
private Map notebookCounts;
private Map tagCounts;
private int trashCount;
// isset id assignments
private static final int __TRASHCOUNT_ISSET_ID = 0;
private boolean[] __isset_vector = new boolean[1];
public NoteCollectionCounts() {
}
/**
* Performs a deep copy on other.
*/
public NoteCollectionCounts(NoteCollectionCounts other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
if (other.isSetNotebookCounts()) {
Map __this__notebookCounts = new HashMap();
for (Map.Entry other_element : other.notebookCounts.entrySet()) {
String other_element_key = other_element.getKey();
Integer other_element_value = other_element.getValue();
String __this__notebookCounts_copy_key = other_element_key;
Integer __this__notebookCounts_copy_value = other_element_value;
__this__notebookCounts.put(__this__notebookCounts_copy_key, __this__notebookCounts_copy_value);
}
this.notebookCounts = __this__notebookCounts;
}
if (other.isSetTagCounts()) {
Map __this__tagCounts = new HashMap();
for (Map.Entry other_element : other.tagCounts.entrySet()) {
String other_element_key = other_element.getKey();
Integer other_element_value = other_element.getValue();
String __this__tagCounts_copy_key = other_element_key;
Integer __this__tagCounts_copy_value = other_element_value;
__this__tagCounts.put(__this__tagCounts_copy_key, __this__tagCounts_copy_value);
}
this.tagCounts = __this__tagCounts;
}
this.trashCount = other.trashCount;
}
public NoteCollectionCounts deepCopy() {
return new NoteCollectionCounts(this);
}
public void clear() {
this.notebookCounts = null;
this.tagCounts = null;
setTrashCountIsSet(false);
this.trashCount = 0;
}
public int getNotebookCountsSize() {
return (this.notebookCounts == null) ? 0 : this.notebookCounts.size();
}
public void putToNotebookCounts(String key, int val) {
if (this.notebookCounts == null) {
this.notebookCounts = new HashMap();
}
this.notebookCounts.put(key, val);
}
public Map getNotebookCounts() {
return this.notebookCounts;
}
public void setNotebookCounts(Map notebookCounts) {
this.notebookCounts = notebookCounts;
}
public void unsetNotebookCounts() {
this.notebookCounts = null;
}
/** Returns true if field notebookCounts is set (has been asigned a value) and false otherwise */
public boolean isSetNotebookCounts() {
return this.notebookCounts != null;
}
public void setNotebookCountsIsSet(boolean value) {
if (!value) {
this.notebookCounts = null;
}
}
public int getTagCountsSize() {
return (this.tagCounts == null) ? 0 : this.tagCounts.size();
}
public void putToTagCounts(String key, int val) {
if (this.tagCounts == null) {
this.tagCounts = new HashMap();
}
this.tagCounts.put(key, val);
}
public Map getTagCounts() {
return this.tagCounts;
}
public void setTagCounts(Map tagCounts) {
this.tagCounts = tagCounts;
}
public void unsetTagCounts() {
this.tagCounts = null;
}
/** Returns true if field tagCounts is set (has been asigned a value) and false otherwise */
public boolean isSetTagCounts() {
return this.tagCounts != null;
}
public void setTagCountsIsSet(boolean value) {
if (!value) {
this.tagCounts = null;
}
}
public int getTrashCount() {
return this.trashCount;
}
public void setTrashCount(int trashCount) {
this.trashCount = trashCount;
setTrashCountIsSet(true);
}
public void unsetTrashCount() {
__isset_vector[__TRASHCOUNT_ISSET_ID] = false;
}
/** Returns true if field trashCount is set (has been asigned a value) and false otherwise */
public boolean isSetTrashCount() {
return __isset_vector[__TRASHCOUNT_ISSET_ID];
}
public void setTrashCountIsSet(boolean value) {
__isset_vector[__TRASHCOUNT_ISSET_ID] = value;
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof NoteCollectionCounts)
return this.equals((NoteCollectionCounts)that);
return false;
}
public boolean equals(NoteCollectionCounts that) {
if (that == null)
return false;
boolean this_present_notebookCounts = true && this.isSetNotebookCounts();
boolean that_present_notebookCounts = true && that.isSetNotebookCounts();
if (this_present_notebookCounts || that_present_notebookCounts) {
if (!(this_present_notebookCounts && that_present_notebookCounts))
return false;
if (!this.notebookCounts.equals(that.notebookCounts))
return false;
}
boolean this_present_tagCounts = true && this.isSetTagCounts();
boolean that_present_tagCounts = true && that.isSetTagCounts();
if (this_present_tagCounts || that_present_tagCounts) {
if (!(this_present_tagCounts && that_present_tagCounts))
return false;
if (!this.tagCounts.equals(that.tagCounts))
return false;
}
boolean this_present_trashCount = true && this.isSetTrashCount();
boolean that_present_trashCount = true && that.isSetTrashCount();
if (this_present_trashCount || that_present_trashCount) {
if (!(this_present_trashCount && that_present_trashCount))
return false;
if (this.trashCount != that.trashCount)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(NoteCollectionCounts other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
NoteCollectionCounts typedOther = (NoteCollectionCounts)other;
lastComparison = Boolean.valueOf(isSetNotebookCounts()).compareTo(typedOther.isSetNotebookCounts());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNotebookCounts()) { lastComparison = TBaseHelper.compareTo(this.notebookCounts, typedOther.notebookCounts);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTagCounts()).compareTo(typedOther.isSetTagCounts());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTagCounts()) { lastComparison = TBaseHelper.compareTo(this.tagCounts, typedOther.tagCounts);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTrashCount()).compareTo(typedOther.isSetTrashCount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTrashCount()) { lastComparison = TBaseHelper.compareTo(this.trashCount, typedOther.trashCount);
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: // NOTEBOOK_COUNTS
if (field.type == TType.MAP) {
{
TMap _map76 = iprot.readMapBegin();
this.notebookCounts = new HashMap(2*_map76.size);
for (int _i77 = 0; _i77 < _map76.size; ++_i77)
{
String _key78;
int _val79;
_key78 = iprot.readString();
_val79 = iprot.readI32();
this.notebookCounts.put(_key78, _val79);
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // TAG_COUNTS
if (field.type == TType.MAP) {
{
TMap _map80 = iprot.readMapBegin();
this.tagCounts = new HashMap(2*_map80.size);
for (int _i81 = 0; _i81 < _map80.size; ++_i81)
{
String _key82;
int _val83;
_key82 = iprot.readString();
_val83 = iprot.readI32();
this.tagCounts.put(_key82, _val83);
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // TRASH_COUNT
if (field.type == TType.I32) {
this.trashCount = iprot.readI32();
setTrashCountIsSet(true);
} 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.notebookCounts != null) {
if (isSetNotebookCounts()) {
oprot.writeFieldBegin(NOTEBOOK_COUNTS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.I32, this.notebookCounts.size()));
for (Map.Entry _iter84 : this.notebookCounts.entrySet())
{
oprot.writeString(_iter84.getKey());
oprot.writeI32(_iter84.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
if (this.tagCounts != null) {
if (isSetTagCounts()) {
oprot.writeFieldBegin(TAG_COUNTS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.I32, this.tagCounts.size()));
for (Map.Entry _iter85 : this.tagCounts.entrySet())
{
oprot.writeString(_iter85.getKey());
oprot.writeI32(_iter85.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
if (isSetTrashCount()) {
oprot.writeFieldBegin(TRASH_COUNT_FIELD_DESC);
oprot.writeI32(this.trashCount);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("NoteCollectionCounts(");
boolean first = true;
if (isSetNotebookCounts()) {
sb.append("notebookCounts:");
if (this.notebookCounts == null) {
sb.append("null");
} else {
sb.append(this.notebookCounts);
}
first = false;
}
if (isSetTagCounts()) {
if (!first) sb.append(", ");
sb.append("tagCounts:");
if (this.tagCounts == null) {
sb.append("null");
} else {
sb.append(this.tagCounts);
}
first = false;
}
if (isSetTrashCount()) {
if (!first) sb.append(", ");
sb.append("trashCount:");
sb.append(this.trashCount);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}