com.rbkmoney.damsel.fraudbusters.Payment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fraudbusters-proto Show documentation
Show all versions of fraudbusters-proto Show documentation
Generates jar artifact containing compiled thrift classes based on generated thrift IDL files
/**
* Autogenerated by Thrift Compiler (1.0.0-dev)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.rbkmoney.damsel.fraudbusters;
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.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", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-12-02")
public class Payment 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("Payment");
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField EVENT_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("event_time", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField REFERENCE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("reference_info", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField PAYMENT_TOOL_FIELD_DESC = new org.apache.thrift.protocol.TField("payment_tool", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.protocol.TField COST_FIELD_DESC = new org.apache.thrift.protocol.TField("cost", org.apache.thrift.protocol.TType.STRUCT, (short)5);
private static final org.apache.thrift.protocol.TField PROVIDER_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("provider_info", org.apache.thrift.protocol.TType.STRUCT, (short)6);
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)7);
private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)8);
private static final org.apache.thrift.protocol.TField CLIENT_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("client_info", org.apache.thrift.protocol.TType.STRUCT, (short)9);
private static final org.apache.thrift.protocol.TField PAYER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("payer_type", org.apache.thrift.protocol.TType.I32, (short)10);
private static final org.apache.thrift.protocol.TField MOBILE_FIELD_DESC = new org.apache.thrift.protocol.TField("mobile", org.apache.thrift.protocol.TType.BOOL, (short)11);
private static final org.apache.thrift.protocol.TField RECURRENT_FIELD_DESC = new org.apache.thrift.protocol.TField("recurrent", org.apache.thrift.protocol.TType.BOOL, (short)12);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new PaymentStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new PaymentTupleSchemeFactory();
public String id; // required
public String event_time; // required
public ReferenceInfo reference_info; // required
public com.rbkmoney.damsel.domain.PaymentTool payment_tool; // required
public com.rbkmoney.damsel.domain.Cash cost; // required
public ProviderInfo provider_info; // required
/**
*
* @see PaymentStatus
*/
public PaymentStatus status; // required
public Error error; // optional
public ClientInfo client_info; // required
/**
*
* @see PayerType
*/
public PayerType payer_type; // optional
public boolean mobile; // optional
public boolean recurrent; // 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 {
ID((short)1, "id"),
EVENT_TIME((short)2, "event_time"),
REFERENCE_INFO((short)3, "reference_info"),
PAYMENT_TOOL((short)4, "payment_tool"),
COST((short)5, "cost"),
PROVIDER_INFO((short)6, "provider_info"),
/**
*
* @see PaymentStatus
*/
STATUS((short)7, "status"),
ERROR((short)8, "error"),
CLIENT_INFO((short)9, "client_info"),
/**
*
* @see PayerType
*/
PAYER_TYPE((short)10, "payer_type"),
MOBILE((short)11, "mobile"),
RECURRENT((short)12, "recurrent");
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: // ID
return ID;
case 2: // EVENT_TIME
return EVENT_TIME;
case 3: // REFERENCE_INFO
return REFERENCE_INFO;
case 4: // PAYMENT_TOOL
return PAYMENT_TOOL;
case 5: // COST
return COST;
case 6: // PROVIDER_INFO
return PROVIDER_INFO;
case 7: // STATUS
return STATUS;
case 8: // ERROR
return ERROR;
case 9: // CLIENT_INFO
return CLIENT_INFO;
case 10: // PAYER_TYPE
return PAYER_TYPE;
case 11: // MOBILE
return MOBILE;
case 12: // RECURRENT
return RECURRENT;
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 __MOBILE_ISSET_ID = 0;
private static final int __RECURRENT_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.ERROR,_Fields.PAYER_TYPE,_Fields.MOBILE,_Fields.RECURRENT};
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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.EVENT_TIME, new org.apache.thrift.meta_data.FieldMetaData("event_time", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.REFERENCE_INFO, new org.apache.thrift.meta_data.FieldMetaData("reference_info", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ReferenceInfo.class)));
tmpMap.put(_Fields.PAYMENT_TOOL, new org.apache.thrift.meta_data.FieldMetaData("payment_tool", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.rbkmoney.damsel.domain.PaymentTool.class)));
tmpMap.put(_Fields.COST, new org.apache.thrift.meta_data.FieldMetaData("cost", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.rbkmoney.damsel.domain.Cash.class)));
tmpMap.put(_Fields.PROVIDER_INFO, new org.apache.thrift.meta_data.FieldMetaData("provider_info", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProviderInfo.class)));
tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PaymentStatus.class)));
tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Error.class)));
tmpMap.put(_Fields.CLIENT_INFO, new org.apache.thrift.meta_data.FieldMetaData("client_info", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientInfo.class)));
tmpMap.put(_Fields.PAYER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("payer_type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PayerType.class)));
tmpMap.put(_Fields.MOBILE, new org.apache.thrift.meta_data.FieldMetaData("mobile", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.RECURRENT, new org.apache.thrift.meta_data.FieldMetaData("recurrent", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Payment.class, metaDataMap);
}
public Payment() {
}
public Payment(
String id,
String event_time,
ReferenceInfo reference_info,
com.rbkmoney.damsel.domain.PaymentTool payment_tool,
com.rbkmoney.damsel.domain.Cash cost,
ProviderInfo provider_info,
PaymentStatus status,
ClientInfo client_info)
{
this();
this.id = id;
this.event_time = event_time;
this.reference_info = reference_info;
this.payment_tool = payment_tool;
this.cost = cost;
this.provider_info = provider_info;
this.status = status;
this.client_info = client_info;
}
/**
* Performs a deep copy on other.
*/
public Payment(Payment other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetId()) {
this.id = other.id;
}
if (other.isSetEventTime()) {
this.event_time = other.event_time;
}
if (other.isSetReferenceInfo()) {
this.reference_info = new ReferenceInfo(other.reference_info);
}
if (other.isSetPaymentTool()) {
this.payment_tool = new com.rbkmoney.damsel.domain.PaymentTool(other.payment_tool);
}
if (other.isSetCost()) {
this.cost = new com.rbkmoney.damsel.domain.Cash(other.cost);
}
if (other.isSetProviderInfo()) {
this.provider_info = new ProviderInfo(other.provider_info);
}
if (other.isSetStatus()) {
this.status = other.status;
}
if (other.isSetError()) {
this.error = new Error(other.error);
}
if (other.isSetClientInfo()) {
this.client_info = new ClientInfo(other.client_info);
}
if (other.isSetPayerType()) {
this.payer_type = other.payer_type;
}
this.mobile = other.mobile;
this.recurrent = other.recurrent;
}
public Payment deepCopy() {
return new Payment(this);
}
@Override
public void clear() {
this.id = null;
this.event_time = null;
this.reference_info = null;
this.payment_tool = null;
this.cost = null;
this.provider_info = null;
this.status = null;
this.error = null;
this.client_info = null;
this.payer_type = null;
setMobileIsSet(false);
this.mobile = false;
setRecurrentIsSet(false);
this.recurrent = false;
}
public String getId() {
return this.id;
}
public Payment setId(String id) {
this.id = id;
return this;
}
public void unsetId() {
this.id = null;
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return this.id != null;
}
public void setIdIsSet(boolean value) {
if (!value) {
this.id = null;
}
}
public String getEventTime() {
return this.event_time;
}
public Payment setEventTime(String event_time) {
this.event_time = event_time;
return this;
}
public void unsetEventTime() {
this.event_time = null;
}
/** Returns true if field event_time is set (has been assigned a value) and false otherwise */
public boolean isSetEventTime() {
return this.event_time != null;
}
public void setEventTimeIsSet(boolean value) {
if (!value) {
this.event_time = null;
}
}
public ReferenceInfo getReferenceInfo() {
return this.reference_info;
}
public Payment setReferenceInfo(ReferenceInfo reference_info) {
this.reference_info = reference_info;
return this;
}
public void unsetReferenceInfo() {
this.reference_info = null;
}
/** Returns true if field reference_info is set (has been assigned a value) and false otherwise */
public boolean isSetReferenceInfo() {
return this.reference_info != null;
}
public void setReferenceInfoIsSet(boolean value) {
if (!value) {
this.reference_info = null;
}
}
public com.rbkmoney.damsel.domain.PaymentTool getPaymentTool() {
return this.payment_tool;
}
public Payment setPaymentTool(com.rbkmoney.damsel.domain.PaymentTool payment_tool) {
this.payment_tool = payment_tool;
return this;
}
public void unsetPaymentTool() {
this.payment_tool = null;
}
/** Returns true if field payment_tool is set (has been assigned a value) and false otherwise */
public boolean isSetPaymentTool() {
return this.payment_tool != null;
}
public void setPaymentToolIsSet(boolean value) {
if (!value) {
this.payment_tool = null;
}
}
public com.rbkmoney.damsel.domain.Cash getCost() {
return this.cost;
}
public Payment setCost(com.rbkmoney.damsel.domain.Cash cost) {
this.cost = cost;
return this;
}
public void unsetCost() {
this.cost = null;
}
/** Returns true if field cost is set (has been assigned a value) and false otherwise */
public boolean isSetCost() {
return this.cost != null;
}
public void setCostIsSet(boolean value) {
if (!value) {
this.cost = null;
}
}
public ProviderInfo getProviderInfo() {
return this.provider_info;
}
public Payment setProviderInfo(ProviderInfo provider_info) {
this.provider_info = provider_info;
return this;
}
public void unsetProviderInfo() {
this.provider_info = null;
}
/** Returns true if field provider_info is set (has been assigned a value) and false otherwise */
public boolean isSetProviderInfo() {
return this.provider_info != null;
}
public void setProviderInfoIsSet(boolean value) {
if (!value) {
this.provider_info = null;
}
}
/**
*
* @see PaymentStatus
*/
public PaymentStatus getStatus() {
return this.status;
}
/**
*
* @see PaymentStatus
*/
public Payment setStatus(PaymentStatus status) {
this.status = status;
return this;
}
public void unsetStatus() {
this.status = null;
}
/** Returns true if field status is set (has been assigned a value) and false otherwise */
public boolean isSetStatus() {
return this.status != null;
}
public void setStatusIsSet(boolean value) {
if (!value) {
this.status = null;
}
}
public Error getError() {
return this.error;
}
public Payment setError(Error error) {
this.error = error;
return this;
}
public void unsetError() {
this.error = null;
}
/** Returns true if field error is set (has been assigned a value) and false otherwise */
public boolean isSetError() {
return this.error != null;
}
public void setErrorIsSet(boolean value) {
if (!value) {
this.error = null;
}
}
public ClientInfo getClientInfo() {
return this.client_info;
}
public Payment setClientInfo(ClientInfo client_info) {
this.client_info = client_info;
return this;
}
public void unsetClientInfo() {
this.client_info = null;
}
/** Returns true if field client_info is set (has been assigned a value) and false otherwise */
public boolean isSetClientInfo() {
return this.client_info != null;
}
public void setClientInfoIsSet(boolean value) {
if (!value) {
this.client_info = null;
}
}
/**
*
* @see PayerType
*/
public PayerType getPayerType() {
return this.payer_type;
}
/**
*
* @see PayerType
*/
public Payment setPayerType(PayerType payer_type) {
this.payer_type = payer_type;
return this;
}
public void unsetPayerType() {
this.payer_type = null;
}
/** Returns true if field payer_type is set (has been assigned a value) and false otherwise */
public boolean isSetPayerType() {
return this.payer_type != null;
}
public void setPayerTypeIsSet(boolean value) {
if (!value) {
this.payer_type = null;
}
}
public boolean isMobile() {
return this.mobile;
}
public Payment setMobile(boolean mobile) {
this.mobile = mobile;
setMobileIsSet(true);
return this;
}
public void unsetMobile() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MOBILE_ISSET_ID);
}
/** Returns true if field mobile is set (has been assigned a value) and false otherwise */
public boolean isSetMobile() {
return EncodingUtils.testBit(__isset_bitfield, __MOBILE_ISSET_ID);
}
public void setMobileIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MOBILE_ISSET_ID, value);
}
public boolean isRecurrent() {
return this.recurrent;
}
public Payment setRecurrent(boolean recurrent) {
this.recurrent = recurrent;
setRecurrentIsSet(true);
return this;
}
public void unsetRecurrent() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURRENT_ISSET_ID);
}
/** Returns true if field recurrent is set (has been assigned a value) and false otherwise */
public boolean isSetRecurrent() {
return EncodingUtils.testBit(__isset_bitfield, __RECURRENT_ISSET_ID);
}
public void setRecurrentIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURRENT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
case EVENT_TIME:
if (value == null) {
unsetEventTime();
} else {
setEventTime((String)value);
}
break;
case REFERENCE_INFO:
if (value == null) {
unsetReferenceInfo();
} else {
setReferenceInfo((ReferenceInfo)value);
}
break;
case PAYMENT_TOOL:
if (value == null) {
unsetPaymentTool();
} else {
setPaymentTool((com.rbkmoney.damsel.domain.PaymentTool)value);
}
break;
case COST:
if (value == null) {
unsetCost();
} else {
setCost((com.rbkmoney.damsel.domain.Cash)value);
}
break;
case PROVIDER_INFO:
if (value == null) {
unsetProviderInfo();
} else {
setProviderInfo((ProviderInfo)value);
}
break;
case STATUS:
if (value == null) {
unsetStatus();
} else {
setStatus((PaymentStatus)value);
}
break;
case ERROR:
if (value == null) {
unsetError();
} else {
setError((Error)value);
}
break;
case CLIENT_INFO:
if (value == null) {
unsetClientInfo();
} else {
setClientInfo((ClientInfo)value);
}
break;
case PAYER_TYPE:
if (value == null) {
unsetPayerType();
} else {
setPayerType((PayerType)value);
}
break;
case MOBILE:
if (value == null) {
unsetMobile();
} else {
setMobile((Boolean)value);
}
break;
case RECURRENT:
if (value == null) {
unsetRecurrent();
} else {
setRecurrent((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
case EVENT_TIME:
return getEventTime();
case REFERENCE_INFO:
return getReferenceInfo();
case PAYMENT_TOOL:
return getPaymentTool();
case COST:
return getCost();
case PROVIDER_INFO:
return getProviderInfo();
case STATUS:
return getStatus();
case ERROR:
return getError();
case CLIENT_INFO:
return getClientInfo();
case PAYER_TYPE:
return getPayerType();
case MOBILE:
return isMobile();
case RECURRENT:
return isRecurrent();
}
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 ID:
return isSetId();
case EVENT_TIME:
return isSetEventTime();
case REFERENCE_INFO:
return isSetReferenceInfo();
case PAYMENT_TOOL:
return isSetPaymentTool();
case COST:
return isSetCost();
case PROVIDER_INFO:
return isSetProviderInfo();
case STATUS:
return isSetStatus();
case ERROR:
return isSetError();
case CLIENT_INFO:
return isSetClientInfo();
case PAYER_TYPE:
return isSetPayerType();
case MOBILE:
return isSetMobile();
case RECURRENT:
return isSetRecurrent();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Payment)
return this.equals((Payment)that);
return false;
}
public boolean equals(Payment that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (!this.id.equals(that.id))
return false;
}
boolean this_present_event_time = true && this.isSetEventTime();
boolean that_present_event_time = true && that.isSetEventTime();
if (this_present_event_time || that_present_event_time) {
if (!(this_present_event_time && that_present_event_time))
return false;
if (!this.event_time.equals(that.event_time))
return false;
}
boolean this_present_reference_info = true && this.isSetReferenceInfo();
boolean that_present_reference_info = true && that.isSetReferenceInfo();
if (this_present_reference_info || that_present_reference_info) {
if (!(this_present_reference_info && that_present_reference_info))
return false;
if (!this.reference_info.equals(that.reference_info))
return false;
}
boolean this_present_payment_tool = true && this.isSetPaymentTool();
boolean that_present_payment_tool = true && that.isSetPaymentTool();
if (this_present_payment_tool || that_present_payment_tool) {
if (!(this_present_payment_tool && that_present_payment_tool))
return false;
if (!this.payment_tool.equals(that.payment_tool))
return false;
}
boolean this_present_cost = true && this.isSetCost();
boolean that_present_cost = true && that.isSetCost();
if (this_present_cost || that_present_cost) {
if (!(this_present_cost && that_present_cost))
return false;
if (!this.cost.equals(that.cost))
return false;
}
boolean this_present_provider_info = true && this.isSetProviderInfo();
boolean that_present_provider_info = true && that.isSetProviderInfo();
if (this_present_provider_info || that_present_provider_info) {
if (!(this_present_provider_info && that_present_provider_info))
return false;
if (!this.provider_info.equals(that.provider_info))
return false;
}
boolean this_present_status = true && this.isSetStatus();
boolean that_present_status = true && that.isSetStatus();
if (this_present_status || that_present_status) {
if (!(this_present_status && that_present_status))
return false;
if (!this.status.equals(that.status))
return false;
}
boolean this_present_error = true && this.isSetError();
boolean that_present_error = true && that.isSetError();
if (this_present_error || that_present_error) {
if (!(this_present_error && that_present_error))
return false;
if (!this.error.equals(that.error))
return false;
}
boolean this_present_client_info = true && this.isSetClientInfo();
boolean that_present_client_info = true && that.isSetClientInfo();
if (this_present_client_info || that_present_client_info) {
if (!(this_present_client_info && that_present_client_info))
return false;
if (!this.client_info.equals(that.client_info))
return false;
}
boolean this_present_payer_type = true && this.isSetPayerType();
boolean that_present_payer_type = true && that.isSetPayerType();
if (this_present_payer_type || that_present_payer_type) {
if (!(this_present_payer_type && that_present_payer_type))
return false;
if (!this.payer_type.equals(that.payer_type))
return false;
}
boolean this_present_mobile = true && this.isSetMobile();
boolean that_present_mobile = true && that.isSetMobile();
if (this_present_mobile || that_present_mobile) {
if (!(this_present_mobile && that_present_mobile))
return false;
if (this.mobile != that.mobile)
return false;
}
boolean this_present_recurrent = true && this.isSetRecurrent();
boolean that_present_recurrent = true && that.isSetRecurrent();
if (this_present_recurrent || that_present_recurrent) {
if (!(this_present_recurrent && that_present_recurrent))
return false;
if (this.recurrent != that.recurrent)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
if (isSetId())
hashCode = hashCode * 8191 + id.hashCode();
hashCode = hashCode * 8191 + ((isSetEventTime()) ? 131071 : 524287);
if (isSetEventTime())
hashCode = hashCode * 8191 + event_time.hashCode();
hashCode = hashCode * 8191 + ((isSetReferenceInfo()) ? 131071 : 524287);
if (isSetReferenceInfo())
hashCode = hashCode * 8191 + reference_info.hashCode();
hashCode = hashCode * 8191 + ((isSetPaymentTool()) ? 131071 : 524287);
if (isSetPaymentTool())
hashCode = hashCode * 8191 + payment_tool.hashCode();
hashCode = hashCode * 8191 + ((isSetCost()) ? 131071 : 524287);
if (isSetCost())
hashCode = hashCode * 8191 + cost.hashCode();
hashCode = hashCode * 8191 + ((isSetProviderInfo()) ? 131071 : 524287);
if (isSetProviderInfo())
hashCode = hashCode * 8191 + provider_info.hashCode();
hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
if (isSetStatus())
hashCode = hashCode * 8191 + status.getValue();
hashCode = hashCode * 8191 + ((isSetError()) ? 131071 : 524287);
if (isSetError())
hashCode = hashCode * 8191 + error.hashCode();
hashCode = hashCode * 8191 + ((isSetClientInfo()) ? 131071 : 524287);
if (isSetClientInfo())
hashCode = hashCode * 8191 + client_info.hashCode();
hashCode = hashCode * 8191 + ((isSetPayerType()) ? 131071 : 524287);
if (isSetPayerType())
hashCode = hashCode * 8191 + payer_type.getValue();
hashCode = hashCode * 8191 + ((isSetMobile()) ? 131071 : 524287);
if (isSetMobile())
hashCode = hashCode * 8191 + ((mobile) ? 131071 : 524287);
hashCode = hashCode * 8191 + ((isSetRecurrent()) ? 131071 : 524287);
if (isSetRecurrent())
hashCode = hashCode * 8191 + ((recurrent) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(Payment other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetEventTime()).compareTo(other.isSetEventTime());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEventTime()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.event_time, other.event_time);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetReferenceInfo()).compareTo(other.isSetReferenceInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReferenceInfo()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reference_info, other.reference_info);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPaymentTool()).compareTo(other.isSetPaymentTool());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPaymentTool()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_tool, other.payment_tool);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCost()).compareTo(other.isSetCost());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCost()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cost, other.cost);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetProviderInfo()).compareTo(other.isSetProviderInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProviderInfo()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.provider_info, other.provider_info);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStatus()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetError()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetClientInfo()).compareTo(other.isSetClientInfo());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetClientInfo()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_info, other.client_info);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPayerType()).compareTo(other.isSetPayerType());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPayerType()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payer_type, other.payer_type);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMobile()).compareTo(other.isSetMobile());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMobile()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mobile, other.mobile);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetRecurrent()).compareTo(other.isSetRecurrent());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRecurrent()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recurrent, other.recurrent);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public _Fields[] getFields() {
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("Payment(");
boolean first = true;
sb.append("id:");
if (this.id == null) {
sb.append("null");
} else {
sb.append(this.id);
}
first = false;
if (!first) sb.append(", ");
sb.append("event_time:");
if (this.event_time == null) {
sb.append("null");
} else {
sb.append(this.event_time);
}
first = false;
if (!first) sb.append(", ");
sb.append("reference_info:");
if (this.reference_info == null) {
sb.append("null");
} else {
sb.append(this.reference_info);
}
first = false;
if (!first) sb.append(", ");
sb.append("payment_tool:");
if (this.payment_tool == null) {
sb.append("null");
} else {
sb.append(this.payment_tool);
}
first = false;
if (!first) sb.append(", ");
sb.append("cost:");
if (this.cost == null) {
sb.append("null");
} else {
sb.append(this.cost);
}
first = false;
if (!first) sb.append(", ");
sb.append("provider_info:");
if (this.provider_info == null) {
sb.append("null");
} else {
sb.append(this.provider_info);
}
first = false;
if (!first) sb.append(", ");
sb.append("status:");
if (this.status == null) {
sb.append("null");
} else {
sb.append(this.status);
}
first = false;
if (isSetError()) {
if (!first) sb.append(", ");
sb.append("error:");
if (this.error == null) {
sb.append("null");
} else {
sb.append(this.error);
}
first = false;
}
if (!first) sb.append(", ");
sb.append("client_info:");
if (this.client_info == null) {
sb.append("null");
} else {
sb.append(this.client_info);
}
first = false;
if (isSetPayerType()) {
if (!first) sb.append(", ");
sb.append("payer_type:");
if (this.payer_type == null) {
sb.append("null");
} else {
sb.append(this.payer_type);
}
first = false;
}
if (isSetMobile()) {
if (!first) sb.append(", ");
sb.append("mobile:");
sb.append(this.mobile);
first = false;
}
if (isSetRecurrent()) {
if (!first) sb.append(", ");
sb.append("recurrent:");
sb.append(this.recurrent);
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (id == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' was not present! Struct: " + toString());
}
if (event_time == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'event_time' was not present! Struct: " + toString());
}
if (reference_info == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'reference_info' was not present! Struct: " + toString());
}
if (payment_tool == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'payment_tool' was not present! Struct: " + toString());
}
if (cost == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'cost' was not present! Struct: " + toString());
}
if (provider_info == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'provider_info' was not present! Struct: " + toString());
}
if (status == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
}
if (client_info == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_info' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (cost != null) {
cost.validate();
}
if (provider_info != null) {
provider_info.validate();
}
if (error != null) {
error.validate();
}
if (client_info != null) {
client_info.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class PaymentStandardSchemeFactory implements SchemeFactory {
public PaymentStandardScheme getScheme() {
return new PaymentStandardScheme();
}
}
private static class PaymentStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, Payment struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // EVENT_TIME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.event_time = iprot.readString();
struct.setEventTimeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // REFERENCE_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.reference_info = new ReferenceInfo();
struct.reference_info.read(iprot);
struct.setReferenceInfoIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // PAYMENT_TOOL
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.payment_tool = new com.rbkmoney.damsel.domain.PaymentTool();
struct.payment_tool.read(iprot);
struct.setPaymentToolIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // COST
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.cost = new com.rbkmoney.damsel.domain.Cash();
struct.cost.read(iprot);
struct.setCostIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // PROVIDER_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.provider_info = new ProviderInfo();
struct.provider_info.read(iprot);
struct.setProviderInfoIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // STATUS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.status = com.rbkmoney.damsel.fraudbusters.PaymentStatus.findByValue(iprot.readI32());
struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // ERROR
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.error = new Error();
struct.error.read(iprot);
struct.setErrorIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // CLIENT_INFO
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.client_info = new ClientInfo();
struct.client_info.read(iprot);
struct.setClientInfoIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // PAYER_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.payer_type = com.rbkmoney.damsel.fraudbusters.PayerType.findByValue(iprot.readI32());
struct.setPayerTypeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // MOBILE
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.mobile = iprot.readBool();
struct.setMobileIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 12: // RECURRENT
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.recurrent = iprot.readBool();
struct.setRecurrentIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, Payment struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.id != null) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeString(struct.id);
oprot.writeFieldEnd();
}
if (struct.event_time != null) {
oprot.writeFieldBegin(EVENT_TIME_FIELD_DESC);
oprot.writeString(struct.event_time);
oprot.writeFieldEnd();
}
if (struct.reference_info != null) {
oprot.writeFieldBegin(REFERENCE_INFO_FIELD_DESC);
struct.reference_info.write(oprot);
oprot.writeFieldEnd();
}
if (struct.payment_tool != null) {
oprot.writeFieldBegin(PAYMENT_TOOL_FIELD_DESC);
struct.payment_tool.write(oprot);
oprot.writeFieldEnd();
}
if (struct.cost != null) {
oprot.writeFieldBegin(COST_FIELD_DESC);
struct.cost.write(oprot);
oprot.writeFieldEnd();
}
if (struct.provider_info != null) {
oprot.writeFieldBegin(PROVIDER_INFO_FIELD_DESC);
struct.provider_info.write(oprot);
oprot.writeFieldEnd();
}
if (struct.status != null) {
oprot.writeFieldBegin(STATUS_FIELD_DESC);
oprot.writeI32(struct.status.getValue());
oprot.writeFieldEnd();
}
if (struct.error != null) {
if (struct.isSetError()) {
oprot.writeFieldBegin(ERROR_FIELD_DESC);
struct.error.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.client_info != null) {
oprot.writeFieldBegin(CLIENT_INFO_FIELD_DESC);
struct.client_info.write(oprot);
oprot.writeFieldEnd();
}
if (struct.payer_type != null) {
if (struct.isSetPayerType()) {
oprot.writeFieldBegin(PAYER_TYPE_FIELD_DESC);
oprot.writeI32(struct.payer_type.getValue());
oprot.writeFieldEnd();
}
}
if (struct.isSetMobile()) {
oprot.writeFieldBegin(MOBILE_FIELD_DESC);
oprot.writeBool(struct.mobile);
oprot.writeFieldEnd();
}
if (struct.isSetRecurrent()) {
oprot.writeFieldBegin(RECURRENT_FIELD_DESC);
oprot.writeBool(struct.recurrent);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class PaymentTupleSchemeFactory implements SchemeFactory {
public PaymentTupleScheme getScheme() {
return new PaymentTupleScheme();
}
}
private static class PaymentTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Payment struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.id);
oprot.writeString(struct.event_time);
struct.reference_info.write(oprot);
struct.payment_tool.write(oprot);
struct.cost.write(oprot);
struct.provider_info.write(oprot);
oprot.writeI32(struct.status.getValue());
struct.client_info.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetError()) {
optionals.set(0);
}
if (struct.isSetPayerType()) {
optionals.set(1);
}
if (struct.isSetMobile()) {
optionals.set(2);
}
if (struct.isSetRecurrent()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetError()) {
struct.error.write(oprot);
}
if (struct.isSetPayerType()) {
oprot.writeI32(struct.payer_type.getValue());
}
if (struct.isSetMobile()) {
oprot.writeBool(struct.mobile);
}
if (struct.isSetRecurrent()) {
oprot.writeBool(struct.recurrent);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Payment struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.id = iprot.readString();
struct.setIdIsSet(true);
struct.event_time = iprot.readString();
struct.setEventTimeIsSet(true);
struct.reference_info = new ReferenceInfo();
struct.reference_info.read(iprot);
struct.setReferenceInfoIsSet(true);
struct.payment_tool = new com.rbkmoney.damsel.domain.PaymentTool();
struct.payment_tool.read(iprot);
struct.setPaymentToolIsSet(true);
struct.cost = new com.rbkmoney.damsel.domain.Cash();
struct.cost.read(iprot);
struct.setCostIsSet(true);
struct.provider_info = new ProviderInfo();
struct.provider_info.read(iprot);
struct.setProviderInfoIsSet(true);
struct.status = com.rbkmoney.damsel.fraudbusters.PaymentStatus.findByValue(iprot.readI32());
struct.setStatusIsSet(true);
struct.client_info = new ClientInfo();
struct.client_info.read(iprot);
struct.setClientInfoIsSet(true);
BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.error = new Error();
struct.error.read(iprot);
struct.setErrorIsSet(true);
}
if (incoming.get(1)) {
struct.payer_type = com.rbkmoney.damsel.fraudbusters.PayerType.findByValue(iprot.readI32());
struct.setPayerTypeIsSet(true);
}
if (incoming.get(2)) {
struct.mobile = iprot.readBool();
struct.setMobileIsSet(true);
}
if (incoming.get(3)) {
struct.recurrent = iprot.readBool();
struct.setRecurrentIsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}