
tech.aroma.thrift.application.service.SendMessageRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aroma-thrift Show documentation
Show all versions of aroma-thrift Show documentation
Part of the Aroma Project.
This project contains the Service and Model Definitions.
From this the Server and Client interfaces are generated for the Aroma Service.
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package tech.aroma.thrift.application.service;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Send a Message to Aroma.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-10")
public class SendMessageRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SendMessageRequest");
private static final org.apache.thrift.protocol.TField APPLICATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationToken", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField BODY_FIELD_DESC = new org.apache.thrift.protocol.TField("body", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField URGENCY_FIELD_DESC = new org.apache.thrift.protocol.TField("urgency", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.protocol.TField TIME_OF_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfMessage", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField HOSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("hostname", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField MAC_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("macAddress", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final org.apache.thrift.protocol.TField IPV4_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("ipv4Address", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new SendMessageRequestStandardSchemeFactory());
schemes.put(TupleScheme.class, new SendMessageRequestTupleSchemeFactory());
}
public tech.aroma.thrift.authentication.ApplicationToken applicationToken; // required
public String body; // required
public tech.aroma.thrift.Urgency urgency; // required
/**
* The time that the message was generated on the Client Side.
*/
public long timeOfMessage; // optional
public String title; // required
public String hostname; // optional
public String macAddress; // optional
public String ipv4Address; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
APPLICATION_TOKEN((short)1, "applicationToken"),
BODY((short)2, "body"),
URGENCY((short)3, "urgency"),
/**
* The time that the message was generated on the Client Side.
*/
TIME_OF_MESSAGE((short)4, "timeOfMessage"),
TITLE((short)5, "title"),
HOSTNAME((short)6, "hostname"),
MAC_ADDRESS((short)7, "macAddress"),
IPV4_ADDRESS((short)8, "ipv4Address");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // APPLICATION_TOKEN
return APPLICATION_TOKEN;
case 2: // BODY
return BODY;
case 3: // URGENCY
return URGENCY;
case 4: // TIME_OF_MESSAGE
return TIME_OF_MESSAGE;
case 5: // TITLE
return TITLE;
case 6: // HOSTNAME
return HOSTNAME;
case 7: // MAC_ADDRESS
return MAC_ADDRESS;
case 8: // IPV4_ADDRESS
return IPV4_ADDRESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __TIMEOFMESSAGE_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.TIME_OF_MESSAGE,_Fields.HOSTNAME,_Fields.MAC_ADDRESS,_Fields.IPV4_ADDRESS};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.APPLICATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("applicationToken", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "ApplicationToken")));
tmpMap.put(_Fields.BODY, new org.apache.thrift.meta_data.FieldMetaData("body", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.URGENCY, new org.apache.thrift.meta_data.FieldMetaData("urgency", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.ENUM , "Urgency")));
tmpMap.put(_Fields.TIME_OF_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("timeOfMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "timestamp")));
tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.HOSTNAME, new org.apache.thrift.meta_data.FieldMetaData("hostname", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MAC_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("macAddress", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IPV4_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("ipv4Address", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SendMessageRequest.class, metaDataMap);
}
public SendMessageRequest() {
this.urgency = tech.aroma.thrift.Urgency.LOW;
}
public SendMessageRequest(
tech.aroma.thrift.authentication.ApplicationToken applicationToken,
String body,
tech.aroma.thrift.Urgency urgency,
String title)
{
this();
this.applicationToken = applicationToken;
this.body = body;
this.urgency = urgency;
this.title = title;
}
/**
* Performs a deep copy on other.
*/
public SendMessageRequest(SendMessageRequest other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetApplicationToken()) {
this.applicationToken = other.applicationToken;
}
if (other.isSetBody()) {
this.body = other.body;
}
if (other.isSetUrgency()) {
this.urgency = other.urgency;
}
this.timeOfMessage = other.timeOfMessage;
if (other.isSetTitle()) {
this.title = other.title;
}
if (other.isSetHostname()) {
this.hostname = other.hostname;
}
if (other.isSetMacAddress()) {
this.macAddress = other.macAddress;
}
if (other.isSetIpv4Address()) {
this.ipv4Address = other.ipv4Address;
}
}
public SendMessageRequest deepCopy() {
return new SendMessageRequest(this);
}
@Override
public void clear() {
this.applicationToken = null;
this.body = null;
this.urgency = tech.aroma.thrift.Urgency.LOW;
setTimeOfMessageIsSet(false);
this.timeOfMessage = 0;
this.title = null;
this.hostname = null;
this.macAddress = null;
this.ipv4Address = null;
}
public tech.aroma.thrift.authentication.ApplicationToken getApplicationToken() {
return this.applicationToken;
}
public SendMessageRequest setApplicationToken(tech.aroma.thrift.authentication.ApplicationToken applicationToken) {
this.applicationToken = applicationToken;
return this;
}
public void unsetApplicationToken() {
this.applicationToken = null;
}
/** Returns true if field applicationToken is set (has been assigned a value) and false otherwise */
public boolean isSetApplicationToken() {
return this.applicationToken != null;
}
public void setApplicationTokenIsSet(boolean value) {
if (!value) {
this.applicationToken = null;
}
}
public String getBody() {
return this.body;
}
public SendMessageRequest setBody(String body) {
this.body = body;
return this;
}
public void unsetBody() {
this.body = null;
}
/** Returns true if field body is set (has been assigned a value) and false otherwise */
public boolean isSetBody() {
return this.body != null;
}
public void setBodyIsSet(boolean value) {
if (!value) {
this.body = null;
}
}
public tech.aroma.thrift.Urgency getUrgency() {
return this.urgency;
}
public SendMessageRequest setUrgency(tech.aroma.thrift.Urgency urgency) {
this.urgency = urgency;
return this;
}
public void unsetUrgency() {
this.urgency = null;
}
/** Returns true if field urgency is set (has been assigned a value) and false otherwise */
public boolean isSetUrgency() {
return this.urgency != null;
}
public void setUrgencyIsSet(boolean value) {
if (!value) {
this.urgency = null;
}
}
/**
* The time that the message was generated on the Client Side.
*/
public long getTimeOfMessage() {
return this.timeOfMessage;
}
/**
* The time that the message was generated on the Client Side.
*/
public SendMessageRequest setTimeOfMessage(long timeOfMessage) {
this.timeOfMessage = timeOfMessage;
setTimeOfMessageIsSet(true);
return this;
}
public void unsetTimeOfMessage() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFMESSAGE_ISSET_ID);
}
/** Returns true if field timeOfMessage is set (has been assigned a value) and false otherwise */
public boolean isSetTimeOfMessage() {
return EncodingUtils.testBit(__isset_bitfield, __TIMEOFMESSAGE_ISSET_ID);
}
public void setTimeOfMessageIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFMESSAGE_ISSET_ID, value);
}
public String getTitle() {
return this.title;
}
public SendMessageRequest setTitle(String title) {
this.title = title;
return this;
}
public void unsetTitle() {
this.title = null;
}
/** Returns true if field title is set (has been assigned a value) and false otherwise */
public boolean isSetTitle() {
return this.title != null;
}
public void setTitleIsSet(boolean value) {
if (!value) {
this.title = null;
}
}
public String getHostname() {
return this.hostname;
}
public SendMessageRequest setHostname(String hostname) {
this.hostname = hostname;
return this;
}
public void unsetHostname() {
this.hostname = null;
}
/** Returns true if field hostname is set (has been assigned a value) and false otherwise */
public boolean isSetHostname() {
return this.hostname != null;
}
public void setHostnameIsSet(boolean value) {
if (!value) {
this.hostname = null;
}
}
public String getMacAddress() {
return this.macAddress;
}
public SendMessageRequest setMacAddress(String macAddress) {
this.macAddress = macAddress;
return this;
}
public void unsetMacAddress() {
this.macAddress = null;
}
/** Returns true if field macAddress is set (has been assigned a value) and false otherwise */
public boolean isSetMacAddress() {
return this.macAddress != null;
}
public void setMacAddressIsSet(boolean value) {
if (!value) {
this.macAddress = null;
}
}
public String getIpv4Address() {
return this.ipv4Address;
}
public SendMessageRequest setIpv4Address(String ipv4Address) {
this.ipv4Address = ipv4Address;
return this;
}
public void unsetIpv4Address() {
this.ipv4Address = null;
}
/** Returns true if field ipv4Address is set (has been assigned a value) and false otherwise */
public boolean isSetIpv4Address() {
return this.ipv4Address != null;
}
public void setIpv4AddressIsSet(boolean value) {
if (!value) {
this.ipv4Address = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case APPLICATION_TOKEN:
if (value == null) {
unsetApplicationToken();
} else {
setApplicationToken((tech.aroma.thrift.authentication.ApplicationToken)value);
}
break;
case BODY:
if (value == null) {
unsetBody();
} else {
setBody((String)value);
}
break;
case URGENCY:
if (value == null) {
unsetUrgency();
} else {
setUrgency((tech.aroma.thrift.Urgency)value);
}
break;
case TIME_OF_MESSAGE:
if (value == null) {
unsetTimeOfMessage();
} else {
setTimeOfMessage((Long)value);
}
break;
case TITLE:
if (value == null) {
unsetTitle();
} else {
setTitle((String)value);
}
break;
case HOSTNAME:
if (value == null) {
unsetHostname();
} else {
setHostname((String)value);
}
break;
case MAC_ADDRESS:
if (value == null) {
unsetMacAddress();
} else {
setMacAddress((String)value);
}
break;
case IPV4_ADDRESS:
if (value == null) {
unsetIpv4Address();
} else {
setIpv4Address((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case APPLICATION_TOKEN:
return getApplicationToken();
case BODY:
return getBody();
case URGENCY:
return getUrgency();
case TIME_OF_MESSAGE:
return getTimeOfMessage();
case TITLE:
return getTitle();
case HOSTNAME:
return getHostname();
case MAC_ADDRESS:
return getMacAddress();
case IPV4_ADDRESS:
return getIpv4Address();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case APPLICATION_TOKEN:
return isSetApplicationToken();
case BODY:
return isSetBody();
case URGENCY:
return isSetUrgency();
case TIME_OF_MESSAGE:
return isSetTimeOfMessage();
case TITLE:
return isSetTitle();
case HOSTNAME:
return isSetHostname();
case MAC_ADDRESS:
return isSetMacAddress();
case IPV4_ADDRESS:
return isSetIpv4Address();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof SendMessageRequest)
return this.equals((SendMessageRequest)that);
return false;
}
public boolean equals(SendMessageRequest that) {
if (that == null)
return false;
boolean this_present_applicationToken = true && this.isSetApplicationToken();
boolean that_present_applicationToken = true && that.isSetApplicationToken();
if (this_present_applicationToken || that_present_applicationToken) {
if (!(this_present_applicationToken && that_present_applicationToken))
return false;
if (!this.applicationToken.equals(that.applicationToken))
return false;
}
boolean this_present_body = true && this.isSetBody();
boolean that_present_body = true && that.isSetBody();
if (this_present_body || that_present_body) {
if (!(this_present_body && that_present_body))
return false;
if (!this.body.equals(that.body))
return false;
}
boolean this_present_urgency = true && this.isSetUrgency();
boolean that_present_urgency = true && that.isSetUrgency();
if (this_present_urgency || that_present_urgency) {
if (!(this_present_urgency && that_present_urgency))
return false;
if (!this.urgency.equals(that.urgency))
return false;
}
boolean this_present_timeOfMessage = true && this.isSetTimeOfMessage();
boolean that_present_timeOfMessage = true && that.isSetTimeOfMessage();
if (this_present_timeOfMessage || that_present_timeOfMessage) {
if (!(this_present_timeOfMessage && that_present_timeOfMessage))
return false;
if (this.timeOfMessage != that.timeOfMessage)
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_hostname = true && this.isSetHostname();
boolean that_present_hostname = true && that.isSetHostname();
if (this_present_hostname || that_present_hostname) {
if (!(this_present_hostname && that_present_hostname))
return false;
if (!this.hostname.equals(that.hostname))
return false;
}
boolean this_present_macAddress = true && this.isSetMacAddress();
boolean that_present_macAddress = true && that.isSetMacAddress();
if (this_present_macAddress || that_present_macAddress) {
if (!(this_present_macAddress && that_present_macAddress))
return false;
if (!this.macAddress.equals(that.macAddress))
return false;
}
boolean this_present_ipv4Address = true && this.isSetIpv4Address();
boolean that_present_ipv4Address = true && that.isSetIpv4Address();
if (this_present_ipv4Address || that_present_ipv4Address) {
if (!(this_present_ipv4Address && that_present_ipv4Address))
return false;
if (!this.ipv4Address.equals(that.ipv4Address))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy