com.rbkmoney.damsel.fraudbusters.Chargeback 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 Chargeback 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("Chargeback");
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 PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("payment_id", org.apache.thrift.protocol.TType.STRING, (short)2);
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)3);
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)4);
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)5);
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)6);
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)7);
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)8);
private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I32, (short)9);
private static final org.apache.thrift.protocol.TField CHARGEBACK_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("chargeback_code", org.apache.thrift.protocol.TType.STRING, (short)10);
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)11);
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)12);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new ChargebackStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new ChargebackTupleSchemeFactory();
public String id; // required
public String payment_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 ChargebackStatus
*/
public ChargebackStatus status; // required
/**
*
* @see ChargebackCategory
*/
public ChargebackCategory category; // required
public String chargeback_code; // required
public ClientInfo client_info; // required
/**
*
* @see PayerType
*/
public PayerType payer_type; // 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"),
PAYMENT_ID((short)2, "payment_id"),
EVENT_TIME((short)3, "event_time"),
REFERENCE_INFO((short)4, "reference_info"),
PAYMENT_TOOL((short)5, "payment_tool"),
COST((short)6, "cost"),
PROVIDER_INFO((short)7, "provider_info"),
/**
*
* @see ChargebackStatus
*/
STATUS((short)8, "status"),
/**
*
* @see ChargebackCategory
*/
CATEGORY((short)9, "category"),
CHARGEBACK_CODE((short)10, "chargeback_code"),
CLIENT_INFO((short)11, "client_info"),
/**
*
* @see PayerType
*/
PAYER_TYPE((short)12, "payer_type");
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: // PAYMENT_ID
return PAYMENT_ID;
case 3: // EVENT_TIME
return EVENT_TIME;
case 4: // REFERENCE_INFO
return REFERENCE_INFO;
case 5: // PAYMENT_TOOL
return PAYMENT_TOOL;
case 6: // COST
return COST;
case 7: // PROVIDER_INFO
return PROVIDER_INFO;
case 8: // STATUS
return STATUS;
case 9: // CATEGORY
return CATEGORY;
case 10: // CHARGEBACK_CODE
return CHARGEBACK_CODE;
case 11: // CLIENT_INFO
return CLIENT_INFO;
case 12: // PAYER_TYPE
return PAYER_TYPE;
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 _Fields optionals[] = {_Fields.PAYER_TYPE};
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.PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("payment_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, ChargebackStatus.class)));
tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ChargebackCategory.class)));
tmpMap.put(_Fields.CHARGEBACK_CODE, new org.apache.thrift.meta_data.FieldMetaData("chargeback_code", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Chargeback.class, metaDataMap);
}
public Chargeback() {
}
public Chargeback(
String id,
String payment_id,
String event_time,
ReferenceInfo reference_info,
com.rbkmoney.damsel.domain.PaymentTool payment_tool,
com.rbkmoney.damsel.domain.Cash cost,
ProviderInfo provider_info,
ChargebackStatus status,
ChargebackCategory category,
String chargeback_code,
ClientInfo client_info)
{
this();
this.id = id;
this.payment_id = payment_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.category = category;
this.chargeback_code = chargeback_code;
this.client_info = client_info;
}
/**
* Performs a deep copy on other.
*/
public Chargeback(Chargeback other) {
if (other.isSetId()) {
this.id = other.id;
}
if (other.isSetPaymentId()) {
this.payment_id = other.payment_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.isSetCategory()) {
this.category = other.category;
}
if (other.isSetChargebackCode()) {
this.chargeback_code = other.chargeback_code;
}
if (other.isSetClientInfo()) {
this.client_info = new ClientInfo(other.client_info);
}
if (other.isSetPayerType()) {
this.payer_type = other.payer_type;
}
}
public Chargeback deepCopy() {
return new Chargeback(this);
}
@Override
public void clear() {
this.id = null;
this.payment_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.category = null;
this.chargeback_code = null;
this.client_info = null;
this.payer_type = null;
}
public String getId() {
return this.id;
}
public Chargeback 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 getPaymentId() {
return this.payment_id;
}
public Chargeback setPaymentId(String payment_id) {
this.payment_id = payment_id;
return this;
}
public void unsetPaymentId() {
this.payment_id = null;
}
/** Returns true if field payment_id is set (has been assigned a value) and false otherwise */
public boolean isSetPaymentId() {
return this.payment_id != null;
}
public void setPaymentIdIsSet(boolean value) {
if (!value) {
this.payment_id = null;
}
}
public String getEventTime() {
return this.event_time;
}
public Chargeback 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 Chargeback 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 Chargeback 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 Chargeback 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 Chargeback 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 ChargebackStatus
*/
public ChargebackStatus getStatus() {
return this.status;
}
/**
*
* @see ChargebackStatus
*/
public Chargeback setStatus(ChargebackStatus 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;
}
}
/**
*
* @see ChargebackCategory
*/
public ChargebackCategory getCategory() {
return this.category;
}
/**
*
* @see ChargebackCategory
*/
public Chargeback setCategory(ChargebackCategory category) {
this.category = category;
return this;
}
public void unsetCategory() {
this.category = null;
}
/** Returns true if field category is set (has been assigned a value) and false otherwise */
public boolean isSetCategory() {
return this.category != null;
}
public void setCategoryIsSet(boolean value) {
if (!value) {
this.category = null;
}
}
public String getChargebackCode() {
return this.chargeback_code;
}
public Chargeback setChargebackCode(String chargeback_code) {
this.chargeback_code = chargeback_code;
return this;
}
public void unsetChargebackCode() {
this.chargeback_code = null;
}
/** Returns true if field chargeback_code is set (has been assigned a value) and false otherwise */
public boolean isSetChargebackCode() {
return this.chargeback_code != null;
}
public void setChargebackCodeIsSet(boolean value) {
if (!value) {
this.chargeback_code = null;
}
}
public ClientInfo getClientInfo() {
return this.client_info;
}
public Chargeback 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 Chargeback 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 void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
case PAYMENT_ID:
if (value == null) {
unsetPaymentId();
} else {
setPaymentId((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((ChargebackStatus)value);
}
break;
case CATEGORY:
if (value == null) {
unsetCategory();
} else {
setCategory((ChargebackCategory)value);
}
break;
case CHARGEBACK_CODE:
if (value == null) {
unsetChargebackCode();
} else {
setChargebackCode((String)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;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
case PAYMENT_ID:
return getPaymentId();
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 CATEGORY:
return getCategory();
case CHARGEBACK_CODE:
return getChargebackCode();
case CLIENT_INFO:
return getClientInfo();
case PAYER_TYPE:
return getPayerType();
}
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 PAYMENT_ID:
return isSetPaymentId();
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 CATEGORY:
return isSetCategory();
case CHARGEBACK_CODE:
return isSetChargebackCode();
case CLIENT_INFO:
return isSetClientInfo();
case PAYER_TYPE:
return isSetPayerType();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Chargeback)
return this.equals((Chargeback)that);
return false;
}
public boolean equals(Chargeback 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_payment_id = true && this.isSetPaymentId();
boolean that_present_payment_id = true && that.isSetPaymentId();
if (this_present_payment_id || that_present_payment_id) {
if (!(this_present_payment_id && that_present_payment_id))
return false;
if (!this.payment_id.equals(that.payment_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_category = true && this.isSetCategory();
boolean that_present_category = true && that.isSetCategory();
if (this_present_category || that_present_category) {
if (!(this_present_category && that_present_category))
return false;
if (!this.category.equals(that.category))
return false;
}
boolean this_present_chargeback_code = true && this.isSetChargebackCode();
boolean that_present_chargeback_code = true && that.isSetChargebackCode();
if (this_present_chargeback_code || that_present_chargeback_code) {
if (!(this_present_chargeback_code && that_present_chargeback_code))
return false;
if (!this.chargeback_code.equals(that.chargeback_code))
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;
}
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 + ((isSetPaymentId()) ? 131071 : 524287);
if (isSetPaymentId())
hashCode = hashCode * 8191 + payment_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 + ((isSetCategory()) ? 131071 : 524287);
if (isSetCategory())
hashCode = hashCode * 8191 + category.getValue();
hashCode = hashCode * 8191 + ((isSetChargebackCode()) ? 131071 : 524287);
if (isSetChargebackCode())
hashCode = hashCode * 8191 + chargeback_code.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();
return hashCode;
}
@Override
public int compareTo(Chargeback 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(isSetPaymentId()).compareTo(other.isSetPaymentId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPaymentId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_id, other.payment_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(isSetCategory()).compareTo(other.isSetCategory());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCategory()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, other.category);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetChargebackCode()).compareTo(other.isSetChargebackCode());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetChargebackCode()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chargeback_code, other.chargeback_code);
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;
}
}
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("Chargeback(");
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("payment_id:");
if (this.payment_id == null) {
sb.append("null");
} else {
sb.append(this.payment_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 (!first) sb.append(", ");
sb.append("category:");
if (this.category == null) {
sb.append("null");
} else {
sb.append(this.category);
}
first = false;
if (!first) sb.append(", ");
sb.append("chargeback_code:");
if (this.chargeback_code == null) {
sb.append("null");
} else {
sb.append(this.chargeback_code);
}
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;
}
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 (payment_id == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'payment_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 (category == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'category' was not present! Struct: " + toString());
}
if (chargeback_code == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'chargeback_code' 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 (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 {
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 ChargebackStandardSchemeFactory implements SchemeFactory {
public ChargebackStandardScheme getScheme() {
return new ChargebackStandardScheme();
}
}
private static class ChargebackStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, Chargeback 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: // PAYMENT_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.payment_id = iprot.readString();
struct.setPaymentIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // 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 4: // 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 5: // 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 6: // 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 7: // 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 8: // STATUS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.status = com.rbkmoney.damsel.fraudbusters.ChargebackStatus.findByValue(iprot.readI32());
struct.setStatusIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // CATEGORY
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.category = com.rbkmoney.damsel.fraudbusters.ChargebackCategory.findByValue(iprot.readI32());
struct.setCategoryIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 10: // CHARGEBACK_CODE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.chargeback_code = iprot.readString();
struct.setChargebackCodeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 11: // 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 12: // 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;
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, Chargeback 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.payment_id != null) {
oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
oprot.writeString(struct.payment_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.category != null) {
oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
oprot.writeI32(struct.category.getValue());
oprot.writeFieldEnd();
}
if (struct.chargeback_code != null) {
oprot.writeFieldBegin(CHARGEBACK_CODE_FIELD_DESC);
oprot.writeString(struct.chargeback_code);
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();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ChargebackTupleSchemeFactory implements SchemeFactory {
public ChargebackTupleScheme getScheme() {
return new ChargebackTupleScheme();
}
}
private static class ChargebackTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Chargeback struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
oprot.writeString(struct.id);
oprot.writeString(struct.payment_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());
oprot.writeI32(struct.category.getValue());
oprot.writeString(struct.chargeback_code);
struct.client_info.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetPayerType()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetPayerType()) {
oprot.writeI32(struct.payer_type.getValue());
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Chargeback struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.id = iprot.readString();
struct.setIdIsSet(true);
struct.payment_id = iprot.readString();
struct.setPaymentIdIsSet(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.ChargebackStatus.findByValue(iprot.readI32());
struct.setStatusIsSet(true);
struct.category = com.rbkmoney.damsel.fraudbusters.ChargebackCategory.findByValue(iprot.readI32());
struct.setCategoryIsSet(true);
struct.chargeback_code = iprot.readString();
struct.setChargebackCodeIsSet(true);
struct.client_info = new ClientInfo();
struct.client_info.read(iprot);
struct.setClientInfoIsSet(true);
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.payer_type = com.rbkmoney.damsel.fraudbusters.PayerType.findByValue(iprot.readI32());
struct.setPayerTypeIsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}