com.evernote.edam.type.SharedNotebookRecipientSettings 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.*;
/**
* Settings meant for the recipient of a shared notebook, such as
* for indicating which types of notifications the recipient wishes
* for reminders, etc.
*
* The reminderNotifyEmail and reminderNotifyInApp fields have a
* 3-state read value but a 2-state write value. On read, it is
* possible to observe "unset", true, or false. The initial state is
* "unset". When you choose to set a value, you may set it to either
* true or false, but you cannot unset the value. Once one of these
* members has a true/false value, it will always have a true/false
* value.
*
*
* - reminderNotifyEmail
* - Indicates that the user wishes to receive daily e-mail notifications
* for reminders associated with the shared notebook. This may be
* true only for business notebooks that belong to the business of
* which the user is a member. You may only set this value on a
* notebook in your business.
* - reminderNotifyInApp
* - Indicates that the user wishes to receive notifications for
* reminders by applications that support providing such
* notifications. The exact nature of the notification is defined
* by the individual applications.
*
*
*/
public class SharedNotebookRecipientSettings implements TBase, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("SharedNotebookRecipientSettings");
private static final TField REMINDER_NOTIFY_EMAIL_FIELD_DESC = new TField("reminderNotifyEmail", TType.BOOL, (short)1);
private static final TField REMINDER_NOTIFY_IN_APP_FIELD_DESC = new TField("reminderNotifyInApp", TType.BOOL, (short)2);
private boolean reminderNotifyEmail;
private boolean reminderNotifyInApp;
// isset id assignments
private static final int __REMINDERNOTIFYEMAIL_ISSET_ID = 0;
private static final int __REMINDERNOTIFYINAPP_ISSET_ID = 1;
private boolean[] __isset_vector = new boolean[2];
public SharedNotebookRecipientSettings() {
}
/**
* Performs a deep copy on other.
*/
public SharedNotebookRecipientSettings(SharedNotebookRecipientSettings other) {
System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, other.__isset_vector.length);
this.reminderNotifyEmail = other.reminderNotifyEmail;
this.reminderNotifyInApp = other.reminderNotifyInApp;
}
public SharedNotebookRecipientSettings deepCopy() {
return new SharedNotebookRecipientSettings(this);
}
public void clear() {
setReminderNotifyEmailIsSet(false);
this.reminderNotifyEmail = false;
setReminderNotifyInAppIsSet(false);
this.reminderNotifyInApp = false;
}
public boolean isReminderNotifyEmail() {
return this.reminderNotifyEmail;
}
public void setReminderNotifyEmail(boolean reminderNotifyEmail) {
this.reminderNotifyEmail = reminderNotifyEmail;
setReminderNotifyEmailIsSet(true);
}
public void unsetReminderNotifyEmail() {
__isset_vector[__REMINDERNOTIFYEMAIL_ISSET_ID] = false;
}
/** Returns true if field reminderNotifyEmail is set (has been asigned a value) and false otherwise */
public boolean isSetReminderNotifyEmail() {
return __isset_vector[__REMINDERNOTIFYEMAIL_ISSET_ID];
}
public void setReminderNotifyEmailIsSet(boolean value) {
__isset_vector[__REMINDERNOTIFYEMAIL_ISSET_ID] = value;
}
public boolean isReminderNotifyInApp() {
return this.reminderNotifyInApp;
}
public void setReminderNotifyInApp(boolean reminderNotifyInApp) {
this.reminderNotifyInApp = reminderNotifyInApp;
setReminderNotifyInAppIsSet(true);
}
public void unsetReminderNotifyInApp() {
__isset_vector[__REMINDERNOTIFYINAPP_ISSET_ID] = false;
}
/** Returns true if field reminderNotifyInApp is set (has been asigned a value) and false otherwise */
public boolean isSetReminderNotifyInApp() {
return __isset_vector[__REMINDERNOTIFYINAPP_ISSET_ID];
}
public void setReminderNotifyInAppIsSet(boolean value) {
__isset_vector[__REMINDERNOTIFYINAPP_ISSET_ID] = value;
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SharedNotebookRecipientSettings)
return this.equals((SharedNotebookRecipientSettings)that);
return false;
}
public boolean equals(SharedNotebookRecipientSettings that) {
if (that == null)
return false;
boolean this_present_reminderNotifyEmail = true && this.isSetReminderNotifyEmail();
boolean that_present_reminderNotifyEmail = true && that.isSetReminderNotifyEmail();
if (this_present_reminderNotifyEmail || that_present_reminderNotifyEmail) {
if (!(this_present_reminderNotifyEmail && that_present_reminderNotifyEmail))
return false;
if (this.reminderNotifyEmail != that.reminderNotifyEmail)
return false;
}
boolean this_present_reminderNotifyInApp = true && this.isSetReminderNotifyInApp();
boolean that_present_reminderNotifyInApp = true && that.isSetReminderNotifyInApp();
if (this_present_reminderNotifyInApp || that_present_reminderNotifyInApp) {
if (!(this_present_reminderNotifyInApp && that_present_reminderNotifyInApp))
return false;
if (this.reminderNotifyInApp != that.reminderNotifyInApp)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(SharedNotebookRecipientSettings other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SharedNotebookRecipientSettings typedOther = (SharedNotebookRecipientSettings)other;
lastComparison = Boolean.valueOf(isSetReminderNotifyEmail()).compareTo(typedOther.isSetReminderNotifyEmail());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReminderNotifyEmail()) { lastComparison = TBaseHelper.compareTo(this.reminderNotifyEmail, typedOther.reminderNotifyEmail);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetReminderNotifyInApp()).compareTo(typedOther.isSetReminderNotifyInApp());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReminderNotifyInApp()) { lastComparison = TBaseHelper.compareTo(this.reminderNotifyInApp, typedOther.reminderNotifyInApp);
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: // REMINDER_NOTIFY_EMAIL
if (field.type == TType.BOOL) {
this.reminderNotifyEmail = iprot.readBool();
setReminderNotifyEmailIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // REMINDER_NOTIFY_IN_APP
if (field.type == TType.BOOL) {
this.reminderNotifyInApp = iprot.readBool();
setReminderNotifyInAppIsSet(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 (isSetReminderNotifyEmail()) {
oprot.writeFieldBegin(REMINDER_NOTIFY_EMAIL_FIELD_DESC);
oprot.writeBool(this.reminderNotifyEmail);
oprot.writeFieldEnd();
}
if (isSetReminderNotifyInApp()) {
oprot.writeFieldBegin(REMINDER_NOTIFY_IN_APP_FIELD_DESC);
oprot.writeBool(this.reminderNotifyInApp);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("SharedNotebookRecipientSettings(");
boolean first = true;
if (isSetReminderNotifyEmail()) {
sb.append("reminderNotifyEmail:");
sb.append(this.reminderNotifyEmail);
first = false;
}
if (isSetReminderNotifyInApp()) {
if (!first) sb.append(", ");
sb.append("reminderNotifyInApp:");
sb.append(this.reminderNotifyInApp);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}