com.empayre.transfer.NonResidentSenderPersonalData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of personal-data-storage-proto Show documentation
Show all versions of personal-data-storage-proto Show documentation
Generates jar artifact containing compiled thrift classes based on generated thrift IDL files
/**
* Autogenerated by Thrift Compiler (0.17.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.empayre.transfer;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.17.0)", date = "2024-06-14")
public class NonResidentSenderPersonalData 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("NonResidentSenderPersonalData");
private static final org.apache.thrift.protocol.TField PERSON_PASSPORT_FIELD_DESC = new org.apache.thrift.protocol.TField("person_passport", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField SENDER_BANK_ACCOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("sender_bank_account", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField INN_FIELD_DESC = new org.apache.thrift.protocol.TField("inn", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField MIGRATION_CARD_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("migration_card_number", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new NonResidentSenderPersonalDataStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new NonResidentSenderPersonalDataTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable PersonPassport person_passport; // required
public @org.apache.thrift.annotation.Nullable SenderBankAccount sender_bank_account; // required
public @org.apache.thrift.annotation.Nullable java.lang.String inn; // required
public @org.apache.thrift.annotation.Nullable java.lang.String migration_card_number; // 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 {
PERSON_PASSPORT((short)1, "person_passport"),
SENDER_BANK_ACCOUNT((short)2, "sender_bank_account"),
INN((short)3, "inn"),
MIGRATION_CARD_NUMBER((short)4, "migration_card_number");
private static final java.util.Map byName = new java.util.HashMap();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PERSON_PASSPORT
return PERSON_PASSPORT;
case 2: // SENDER_BANK_ACCOUNT
return SENDER_BANK_ACCOUNT;
case 3: // INN
return INN;
case 4: // MIGRATION_CARD_NUMBER
return MIGRATION_CARD_NUMBER;
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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.MIGRATION_CARD_NUMBER};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PERSON_PASSPORT, new org.apache.thrift.meta_data.FieldMetaData("person_passport", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PersonPassport.class)));
tmpMap.put(_Fields.SENDER_BANK_ACCOUNT, new org.apache.thrift.meta_data.FieldMetaData("sender_bank_account", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SenderBankAccount.class)));
tmpMap.put(_Fields.INN, new org.apache.thrift.meta_data.FieldMetaData("inn", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.MIGRATION_CARD_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("migration_card_number", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NonResidentSenderPersonalData.class, metaDataMap);
}
public NonResidentSenderPersonalData() {
}
public NonResidentSenderPersonalData(
PersonPassport person_passport,
SenderBankAccount sender_bank_account,
java.lang.String inn)
{
this();
this.person_passport = person_passport;
this.sender_bank_account = sender_bank_account;
this.inn = inn;
}
/**
* Performs a deep copy on other.
*/
public NonResidentSenderPersonalData(NonResidentSenderPersonalData other) {
if (other.isSetPersonPassport()) {
this.person_passport = new PersonPassport(other.person_passport);
}
if (other.isSetSenderBankAccount()) {
this.sender_bank_account = new SenderBankAccount(other.sender_bank_account);
}
if (other.isSetInn()) {
this.inn = other.inn;
}
if (other.isSetMigrationCardNumber()) {
this.migration_card_number = other.migration_card_number;
}
}
@Override
public NonResidentSenderPersonalData deepCopy() {
return new NonResidentSenderPersonalData(this);
}
@Override
public void clear() {
this.person_passport = null;
this.sender_bank_account = null;
this.inn = null;
this.migration_card_number = null;
}
@org.apache.thrift.annotation.Nullable
public PersonPassport getPersonPassport() {
return this.person_passport;
}
public NonResidentSenderPersonalData setPersonPassport(@org.apache.thrift.annotation.Nullable PersonPassport person_passport) {
this.person_passport = person_passport;
return this;
}
public void unsetPersonPassport() {
this.person_passport = null;
}
/** Returns true if field person_passport is set (has been assigned a value) and false otherwise */
public boolean isSetPersonPassport() {
return this.person_passport != null;
}
public void setPersonPassportIsSet(boolean value) {
if (!value) {
this.person_passport = null;
}
}
@org.apache.thrift.annotation.Nullable
public SenderBankAccount getSenderBankAccount() {
return this.sender_bank_account;
}
public NonResidentSenderPersonalData setSenderBankAccount(@org.apache.thrift.annotation.Nullable SenderBankAccount sender_bank_account) {
this.sender_bank_account = sender_bank_account;
return this;
}
public void unsetSenderBankAccount() {
this.sender_bank_account = null;
}
/** Returns true if field sender_bank_account is set (has been assigned a value) and false otherwise */
public boolean isSetSenderBankAccount() {
return this.sender_bank_account != null;
}
public void setSenderBankAccountIsSet(boolean value) {
if (!value) {
this.sender_bank_account = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getInn() {
return this.inn;
}
public NonResidentSenderPersonalData setInn(@org.apache.thrift.annotation.Nullable java.lang.String inn) {
this.inn = inn;
return this;
}
public void unsetInn() {
this.inn = null;
}
/** Returns true if field inn is set (has been assigned a value) and false otherwise */
public boolean isSetInn() {
return this.inn != null;
}
public void setInnIsSet(boolean value) {
if (!value) {
this.inn = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getMigrationCardNumber() {
return this.migration_card_number;
}
public NonResidentSenderPersonalData setMigrationCardNumber(@org.apache.thrift.annotation.Nullable java.lang.String migration_card_number) {
this.migration_card_number = migration_card_number;
return this;
}
public void unsetMigrationCardNumber() {
this.migration_card_number = null;
}
/** Returns true if field migration_card_number is set (has been assigned a value) and false otherwise */
public boolean isSetMigrationCardNumber() {
return this.migration_card_number != null;
}
public void setMigrationCardNumberIsSet(boolean value) {
if (!value) {
this.migration_card_number = null;
}
}
@Override
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case PERSON_PASSPORT:
if (value == null) {
unsetPersonPassport();
} else {
setPersonPassport((PersonPassport)value);
}
break;
case SENDER_BANK_ACCOUNT:
if (value == null) {
unsetSenderBankAccount();
} else {
setSenderBankAccount((SenderBankAccount)value);
}
break;
case INN:
if (value == null) {
unsetInn();
} else {
setInn((java.lang.String)value);
}
break;
case MIGRATION_CARD_NUMBER:
if (value == null) {
unsetMigrationCardNumber();
} else {
setMigrationCardNumber((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PERSON_PASSPORT:
return getPersonPassport();
case SENDER_BANK_ACCOUNT:
return getSenderBankAccount();
case INN:
return getInn();
case MIGRATION_CARD_NUMBER:
return getMigrationCardNumber();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case PERSON_PASSPORT:
return isSetPersonPassport();
case SENDER_BANK_ACCOUNT:
return isSetSenderBankAccount();
case INN:
return isSetInn();
case MIGRATION_CARD_NUMBER:
return isSetMigrationCardNumber();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof NonResidentSenderPersonalData)
return this.equals((NonResidentSenderPersonalData)that);
return false;
}
public boolean equals(NonResidentSenderPersonalData that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_person_passport = true && this.isSetPersonPassport();
boolean that_present_person_passport = true && that.isSetPersonPassport();
if (this_present_person_passport || that_present_person_passport) {
if (!(this_present_person_passport && that_present_person_passport))
return false;
if (!this.person_passport.equals(that.person_passport))
return false;
}
boolean this_present_sender_bank_account = true && this.isSetSenderBankAccount();
boolean that_present_sender_bank_account = true && that.isSetSenderBankAccount();
if (this_present_sender_bank_account || that_present_sender_bank_account) {
if (!(this_present_sender_bank_account && that_present_sender_bank_account))
return false;
if (!this.sender_bank_account.equals(that.sender_bank_account))
return false;
}
boolean this_present_inn = true && this.isSetInn();
boolean that_present_inn = true && that.isSetInn();
if (this_present_inn || that_present_inn) {
if (!(this_present_inn && that_present_inn))
return false;
if (!this.inn.equals(that.inn))
return false;
}
boolean this_present_migration_card_number = true && this.isSetMigrationCardNumber();
boolean that_present_migration_card_number = true && that.isSetMigrationCardNumber();
if (this_present_migration_card_number || that_present_migration_card_number) {
if (!(this_present_migration_card_number && that_present_migration_card_number))
return false;
if (!this.migration_card_number.equals(that.migration_card_number))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetPersonPassport()) ? 131071 : 524287);
if (isSetPersonPassport())
hashCode = hashCode * 8191 + person_passport.hashCode();
hashCode = hashCode * 8191 + ((isSetSenderBankAccount()) ? 131071 : 524287);
if (isSetSenderBankAccount())
hashCode = hashCode * 8191 + sender_bank_account.hashCode();
hashCode = hashCode * 8191 + ((isSetInn()) ? 131071 : 524287);
if (isSetInn())
hashCode = hashCode * 8191 + inn.hashCode();
hashCode = hashCode * 8191 + ((isSetMigrationCardNumber()) ? 131071 : 524287);
if (isSetMigrationCardNumber())
hashCode = hashCode * 8191 + migration_card_number.hashCode();
return hashCode;
}
@Override
public int compareTo(NonResidentSenderPersonalData other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetPersonPassport(), other.isSetPersonPassport());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPersonPassport()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.person_passport, other.person_passport);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSenderBankAccount(), other.isSetSenderBankAccount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSenderBankAccount()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sender_bank_account, other.sender_bank_account);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetInn(), other.isSetInn());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInn()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inn, other.inn);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetMigrationCardNumber(), other.isSetMigrationCardNumber());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMigrationCardNumber()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.migration_card_number, other.migration_card_number);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public _Fields[] getFields() {
return _Fields.values();
}
public java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("NonResidentSenderPersonalData(");
boolean first = true;
sb.append("person_passport:");
if (this.person_passport == null) {
sb.append("null");
} else {
sb.append(this.person_passport);
}
first = false;
if (!first) sb.append(", ");
sb.append("sender_bank_account:");
if (this.sender_bank_account == null) {
sb.append("null");
} else {
sb.append(this.sender_bank_account);
}
first = false;
if (!first) sb.append(", ");
sb.append("inn:");
if (this.inn == null) {
sb.append("null");
} else {
sb.append(this.inn);
}
first = false;
if (isSetMigrationCardNumber()) {
if (!first) sb.append(", ");
sb.append("migration_card_number:");
if (this.migration_card_number == null) {
sb.append("null");
} else {
sb.append(this.migration_card_number);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (person_passport != null) {
person_passport.validate();
}
if (sender_bank_account != null) {
sender_bank_account.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, java.lang.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 NonResidentSenderPersonalDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public NonResidentSenderPersonalDataStandardScheme getScheme() {
return new NonResidentSenderPersonalDataStandardScheme();
}
}
private static class NonResidentSenderPersonalDataStandardScheme extends org.apache.thrift.scheme.StandardScheme {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, NonResidentSenderPersonalData 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: // PERSON_PASSPORT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.person_passport = new PersonPassport();
struct.person_passport.read(iprot);
struct.setPersonPassportIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SENDER_BANK_ACCOUNT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.sender_bank_account = new SenderBankAccount();
struct.sender_bank_account.read(iprot);
struct.setSenderBankAccountIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // INN
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.inn = iprot.readString();
struct.setInnIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // MIGRATION_CARD_NUMBER
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.migration_card_number = iprot.readString();
struct.setMigrationCardNumberIsSet(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();
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, NonResidentSenderPersonalData struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.person_passport != null) {
oprot.writeFieldBegin(PERSON_PASSPORT_FIELD_DESC);
struct.person_passport.write(oprot);
oprot.writeFieldEnd();
}
if (struct.sender_bank_account != null) {
oprot.writeFieldBegin(SENDER_BANK_ACCOUNT_FIELD_DESC);
struct.sender_bank_account.write(oprot);
oprot.writeFieldEnd();
}
if (struct.inn != null) {
oprot.writeFieldBegin(INN_FIELD_DESC);
oprot.writeString(struct.inn);
oprot.writeFieldEnd();
}
if (struct.migration_card_number != null) {
if (struct.isSetMigrationCardNumber()) {
oprot.writeFieldBegin(MIGRATION_CARD_NUMBER_FIELD_DESC);
oprot.writeString(struct.migration_card_number);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class NonResidentSenderPersonalDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
@Override
public NonResidentSenderPersonalDataTupleScheme getScheme() {
return new NonResidentSenderPersonalDataTupleScheme();
}
}
private static class NonResidentSenderPersonalDataTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, NonResidentSenderPersonalData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetPersonPassport()) {
optionals.set(0);
}
if (struct.isSetSenderBankAccount()) {
optionals.set(1);
}
if (struct.isSetInn()) {
optionals.set(2);
}
if (struct.isSetMigrationCardNumber()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetPersonPassport()) {
struct.person_passport.write(oprot);
}
if (struct.isSetSenderBankAccount()) {
struct.sender_bank_account.write(oprot);
}
if (struct.isSetInn()) {
oprot.writeString(struct.inn);
}
if (struct.isSetMigrationCardNumber()) {
oprot.writeString(struct.migration_card_number);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, NonResidentSenderPersonalData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.person_passport = new PersonPassport();
struct.person_passport.read(iprot);
struct.setPersonPassportIsSet(true);
}
if (incoming.get(1)) {
struct.sender_bank_account = new SenderBankAccount();
struct.sender_bank_account.read(iprot);
struct.setSenderBankAccountIsSet(true);
}
if (incoming.get(2)) {
struct.inn = iprot.readString();
struct.setInnIsSet(true);
}
if (incoming.get(3)) {
struct.migration_card_number = iprot.readString();
struct.setMigrationCardNumberIsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}