All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rbkmoney.damsel.fraudbusters.PaymentInfo Maven / Gradle / Ivy

Go to download

Generates jar artifact containing compiled thrift classes based on generated thrift IDL files

There is a newer version: 1.99-2a8f6ca
Show newest version
/**
 * 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 = "2021-07-21")
public class PaymentInfo 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("PaymentInfo");

  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 MERCHANT_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("merchant_info", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
  private static final org.apache.thrift.protocol.TField CURRENCY_FIELD_DESC = new org.apache.thrift.protocol.TField("currency", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField CARD_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("card_token", org.apache.thrift.protocol.TType.STRING, (short)6);
  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)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 ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)9);
  private static final org.apache.thrift.protocol.TField PAYMENT_SYSTEM_FIELD_DESC = new org.apache.thrift.protocol.TField("payment_system", org.apache.thrift.protocol.TType.STRING, (short)10);
  private static final org.apache.thrift.protocol.TField PAYMENT_COUNTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("payment_country", org.apache.thrift.protocol.TType.STRING, (short)11);
  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.STRING, (short)12);
  private static final org.apache.thrift.protocol.TField PROVIDER_FIELD_DESC = new org.apache.thrift.protocol.TField("provider", org.apache.thrift.protocol.TType.STRUCT, (short)13);

  private static final SchemeFactory STANDARD_SCHEME_FACTORY = new PaymentInfoStandardSchemeFactory();
  private static final SchemeFactory TUPLE_SCHEME_FACTORY = new PaymentInfoTupleSchemeFactory();

  public String id; // required
  public String event_time; // required
  public MerchantInfo merchant_info; // required
  public long amount; // required
  public String currency; // required
  public String card_token; // optional
  public ClientInfo client_info; // optional
  /**
   * 
   * @see PaymentStatus
   */
  public PaymentStatus status; // required
  public Error error; // required
  public String payment_system; // required
  public String payment_country; // required
  public String payment_tool; // required
  public ProviderInfo provider; // required

  /** 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"),
    MERCHANT_INFO((short)3, "merchant_info"),
    AMOUNT((short)4, "amount"),
    CURRENCY((short)5, "currency"),
    CARD_TOKEN((short)6, "card_token"),
    CLIENT_INFO((short)7, "client_info"),
    /**
     * 
     * @see PaymentStatus
     */
    STATUS((short)8, "status"),
    ERROR((short)9, "error"),
    PAYMENT_SYSTEM((short)10, "payment_system"),
    PAYMENT_COUNTRY((short)11, "payment_country"),
    PAYMENT_TOOL((short)12, "payment_tool"),
    PROVIDER((short)13, "provider");

    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: // MERCHANT_INFO
          return MERCHANT_INFO;
        case 4: // AMOUNT
          return AMOUNT;
        case 5: // CURRENCY
          return CURRENCY;
        case 6: // CARD_TOKEN
          return CARD_TOKEN;
        case 7: // CLIENT_INFO
          return CLIENT_INFO;
        case 8: // STATUS
          return STATUS;
        case 9: // ERROR
          return ERROR;
        case 10: // PAYMENT_SYSTEM
          return PAYMENT_SYSTEM;
        case 11: // PAYMENT_COUNTRY
          return PAYMENT_COUNTRY;
        case 12: // PAYMENT_TOOL
          return PAYMENT_TOOL;
        case 13: // PROVIDER
          return PROVIDER;
        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 __AMOUNT_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.CARD_TOKEN,_Fields.CLIENT_INFO};
  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.MERCHANT_INFO, new org.apache.thrift.meta_data.FieldMetaData("merchant_info", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MerchantInfo.class)));
    tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CURRENCY, new org.apache.thrift.meta_data.FieldMetaData("currency", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CARD_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("card_token", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientInfo.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.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Error.class)));
    tmpMap.put(_Fields.PAYMENT_SYSTEM, new org.apache.thrift.meta_data.FieldMetaData("payment_system", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PAYMENT_COUNTRY, new org.apache.thrift.meta_data.FieldMetaData("payment_country", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PROVIDER, new org.apache.thrift.meta_data.FieldMetaData("provider", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProviderInfo.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PaymentInfo.class, metaDataMap);
  }

  public PaymentInfo() {
  }

  public PaymentInfo(
    String id,
    String event_time,
    MerchantInfo merchant_info,
    long amount,
    String currency,
    PaymentStatus status,
    Error error,
    String payment_system,
    String payment_country,
    String payment_tool,
    ProviderInfo provider)
  {
    this();
    this.id = id;
    this.event_time = event_time;
    this.merchant_info = merchant_info;
    this.amount = amount;
    setAmountIsSet(true);
    this.currency = currency;
    this.status = status;
    this.error = error;
    this.payment_system = payment_system;
    this.payment_country = payment_country;
    this.payment_tool = payment_tool;
    this.provider = provider;
  }

  /**
   * Performs a deep copy on other.
   */
  public PaymentInfo(PaymentInfo other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetEventTime()) {
      this.event_time = other.event_time;
    }
    if (other.isSetMerchantInfo()) {
      this.merchant_info = new MerchantInfo(other.merchant_info);
    }
    this.amount = other.amount;
    if (other.isSetCurrency()) {
      this.currency = other.currency;
    }
    if (other.isSetCardToken()) {
      this.card_token = other.card_token;
    }
    if (other.isSetClientInfo()) {
      this.client_info = new ClientInfo(other.client_info);
    }
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    if (other.isSetError()) {
      this.error = new Error(other.error);
    }
    if (other.isSetPaymentSystem()) {
      this.payment_system = other.payment_system;
    }
    if (other.isSetPaymentCountry()) {
      this.payment_country = other.payment_country;
    }
    if (other.isSetPaymentTool()) {
      this.payment_tool = other.payment_tool;
    }
    if (other.isSetProvider()) {
      this.provider = new ProviderInfo(other.provider);
    }
  }

  public PaymentInfo deepCopy() {
    return new PaymentInfo(this);
  }

  @Override
  public void clear() {
    this.id = null;
    this.event_time = null;
    this.merchant_info = null;
    setAmountIsSet(false);
    this.amount = 0;
    this.currency = null;
    this.card_token = null;
    this.client_info = null;
    this.status = null;
    this.error = null;
    this.payment_system = null;
    this.payment_country = null;
    this.payment_tool = null;
    this.provider = null;
  }

  public String getId() {
    return this.id;
  }

  public PaymentInfo 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 PaymentInfo 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 MerchantInfo getMerchantInfo() {
    return this.merchant_info;
  }

  public PaymentInfo setMerchantInfo(MerchantInfo merchant_info) {
    this.merchant_info = merchant_info;
    return this;
  }

  public void unsetMerchantInfo() {
    this.merchant_info = null;
  }

  /** Returns true if field merchant_info is set (has been assigned a value) and false otherwise */
  public boolean isSetMerchantInfo() {
    return this.merchant_info != null;
  }

  public void setMerchantInfoIsSet(boolean value) {
    if (!value) {
      this.merchant_info = null;
    }
  }

  public long getAmount() {
    return this.amount;
  }

  public PaymentInfo setAmount(long amount) {
    this.amount = amount;
    setAmountIsSet(true);
    return this;
  }

  public void unsetAmount() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AMOUNT_ISSET_ID);
  }

  /** Returns true if field amount is set (has been assigned a value) and false otherwise */
  public boolean isSetAmount() {
    return EncodingUtils.testBit(__isset_bitfield, __AMOUNT_ISSET_ID);
  }

  public void setAmountIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AMOUNT_ISSET_ID, value);
  }

  public String getCurrency() {
    return this.currency;
  }

  public PaymentInfo setCurrency(String currency) {
    this.currency = currency;
    return this;
  }

  public void unsetCurrency() {
    this.currency = null;
  }

  /** Returns true if field currency is set (has been assigned a value) and false otherwise */
  public boolean isSetCurrency() {
    return this.currency != null;
  }

  public void setCurrencyIsSet(boolean value) {
    if (!value) {
      this.currency = null;
    }
  }

  public String getCardToken() {
    return this.card_token;
  }

  public PaymentInfo setCardToken(String card_token) {
    this.card_token = card_token;
    return this;
  }

  public void unsetCardToken() {
    this.card_token = null;
  }

  /** Returns true if field card_token is set (has been assigned a value) and false otherwise */
  public boolean isSetCardToken() {
    return this.card_token != null;
  }

  public void setCardTokenIsSet(boolean value) {
    if (!value) {
      this.card_token = null;
    }
  }

  public ClientInfo getClientInfo() {
    return this.client_info;
  }

  public PaymentInfo 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 PaymentStatus
   */
  public PaymentStatus getStatus() {
    return this.status;
  }

  /**
   * 
   * @see PaymentStatus
   */
  public PaymentInfo 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 PaymentInfo 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 String getPaymentSystem() {
    return this.payment_system;
  }

  public PaymentInfo setPaymentSystem(String payment_system) {
    this.payment_system = payment_system;
    return this;
  }

  public void unsetPaymentSystem() {
    this.payment_system = null;
  }

  /** Returns true if field payment_system is set (has been assigned a value) and false otherwise */
  public boolean isSetPaymentSystem() {
    return this.payment_system != null;
  }

  public void setPaymentSystemIsSet(boolean value) {
    if (!value) {
      this.payment_system = null;
    }
  }

  public String getPaymentCountry() {
    return this.payment_country;
  }

  public PaymentInfo setPaymentCountry(String payment_country) {
    this.payment_country = payment_country;
    return this;
  }

  public void unsetPaymentCountry() {
    this.payment_country = null;
  }

  /** Returns true if field payment_country is set (has been assigned a value) and false otherwise */
  public boolean isSetPaymentCountry() {
    return this.payment_country != null;
  }

  public void setPaymentCountryIsSet(boolean value) {
    if (!value) {
      this.payment_country = null;
    }
  }

  public String getPaymentTool() {
    return this.payment_tool;
  }

  public PaymentInfo setPaymentTool(String 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 ProviderInfo getProvider() {
    return this.provider;
  }

  public PaymentInfo setProvider(ProviderInfo provider) {
    this.provider = provider;
    return this;
  }

  public void unsetProvider() {
    this.provider = null;
  }

  /** Returns true if field provider is set (has been assigned a value) and false otherwise */
  public boolean isSetProvider() {
    return this.provider != null;
  }

  public void setProviderIsSet(boolean value) {
    if (!value) {
      this.provider = null;
    }
  }

  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 MERCHANT_INFO:
      if (value == null) {
        unsetMerchantInfo();
      } else {
        setMerchantInfo((MerchantInfo)value);
      }
      break;

    case AMOUNT:
      if (value == null) {
        unsetAmount();
      } else {
        setAmount((Long)value);
      }
      break;

    case CURRENCY:
      if (value == null) {
        unsetCurrency();
      } else {
        setCurrency((String)value);
      }
      break;

    case CARD_TOKEN:
      if (value == null) {
        unsetCardToken();
      } else {
        setCardToken((String)value);
      }
      break;

    case CLIENT_INFO:
      if (value == null) {
        unsetClientInfo();
      } else {
        setClientInfo((ClientInfo)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 PAYMENT_SYSTEM:
      if (value == null) {
        unsetPaymentSystem();
      } else {
        setPaymentSystem((String)value);
      }
      break;

    case PAYMENT_COUNTRY:
      if (value == null) {
        unsetPaymentCountry();
      } else {
        setPaymentCountry((String)value);
      }
      break;

    case PAYMENT_TOOL:
      if (value == null) {
        unsetPaymentTool();
      } else {
        setPaymentTool((String)value);
      }
      break;

    case PROVIDER:
      if (value == null) {
        unsetProvider();
      } else {
        setProvider((ProviderInfo)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return getId();

    case EVENT_TIME:
      return getEventTime();

    case MERCHANT_INFO:
      return getMerchantInfo();

    case AMOUNT:
      return getAmount();

    case CURRENCY:
      return getCurrency();

    case CARD_TOKEN:
      return getCardToken();

    case CLIENT_INFO:
      return getClientInfo();

    case STATUS:
      return getStatus();

    case ERROR:
      return getError();

    case PAYMENT_SYSTEM:
      return getPaymentSystem();

    case PAYMENT_COUNTRY:
      return getPaymentCountry();

    case PAYMENT_TOOL:
      return getPaymentTool();

    case PROVIDER:
      return getProvider();

    }
    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 MERCHANT_INFO:
      return isSetMerchantInfo();
    case AMOUNT:
      return isSetAmount();
    case CURRENCY:
      return isSetCurrency();
    case CARD_TOKEN:
      return isSetCardToken();
    case CLIENT_INFO:
      return isSetClientInfo();
    case STATUS:
      return isSetStatus();
    case ERROR:
      return isSetError();
    case PAYMENT_SYSTEM:
      return isSetPaymentSystem();
    case PAYMENT_COUNTRY:
      return isSetPaymentCountry();
    case PAYMENT_TOOL:
      return isSetPaymentTool();
    case PROVIDER:
      return isSetProvider();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof PaymentInfo)
      return this.equals((PaymentInfo)that);
    return false;
  }

  public boolean equals(PaymentInfo 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_merchant_info = true && this.isSetMerchantInfo();
    boolean that_present_merchant_info = true && that.isSetMerchantInfo();
    if (this_present_merchant_info || that_present_merchant_info) {
      if (!(this_present_merchant_info && that_present_merchant_info))
        return false;
      if (!this.merchant_info.equals(that.merchant_info))
        return false;
    }

    boolean this_present_amount = true;
    boolean that_present_amount = true;
    if (this_present_amount || that_present_amount) {
      if (!(this_present_amount && that_present_amount))
        return false;
      if (this.amount != that.amount)
        return false;
    }

    boolean this_present_currency = true && this.isSetCurrency();
    boolean that_present_currency = true && that.isSetCurrency();
    if (this_present_currency || that_present_currency) {
      if (!(this_present_currency && that_present_currency))
        return false;
      if (!this.currency.equals(that.currency))
        return false;
    }

    boolean this_present_card_token = true && this.isSetCardToken();
    boolean that_present_card_token = true && that.isSetCardToken();
    if (this_present_card_token || that_present_card_token) {
      if (!(this_present_card_token && that_present_card_token))
        return false;
      if (!this.card_token.equals(that.card_token))
        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_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_payment_system = true && this.isSetPaymentSystem();
    boolean that_present_payment_system = true && that.isSetPaymentSystem();
    if (this_present_payment_system || that_present_payment_system) {
      if (!(this_present_payment_system && that_present_payment_system))
        return false;
      if (!this.payment_system.equals(that.payment_system))
        return false;
    }

    boolean this_present_payment_country = true && this.isSetPaymentCountry();
    boolean that_present_payment_country = true && that.isSetPaymentCountry();
    if (this_present_payment_country || that_present_payment_country) {
      if (!(this_present_payment_country && that_present_payment_country))
        return false;
      if (!this.payment_country.equals(that.payment_country))
        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_provider = true && this.isSetProvider();
    boolean that_present_provider = true && that.isSetProvider();
    if (this_present_provider || that_present_provider) {
      if (!(this_present_provider && that_present_provider))
        return false;
      if (!this.provider.equals(that.provider))
        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 + ((isSetMerchantInfo()) ? 131071 : 524287);
    if (isSetMerchantInfo())
      hashCode = hashCode * 8191 + merchant_info.hashCode();

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(amount);

    hashCode = hashCode * 8191 + ((isSetCurrency()) ? 131071 : 524287);
    if (isSetCurrency())
      hashCode = hashCode * 8191 + currency.hashCode();

    hashCode = hashCode * 8191 + ((isSetCardToken()) ? 131071 : 524287);
    if (isSetCardToken())
      hashCode = hashCode * 8191 + card_token.hashCode();

    hashCode = hashCode * 8191 + ((isSetClientInfo()) ? 131071 : 524287);
    if (isSetClientInfo())
      hashCode = hashCode * 8191 + client_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 + ((isSetPaymentSystem()) ? 131071 : 524287);
    if (isSetPaymentSystem())
      hashCode = hashCode * 8191 + payment_system.hashCode();

    hashCode = hashCode * 8191 + ((isSetPaymentCountry()) ? 131071 : 524287);
    if (isSetPaymentCountry())
      hashCode = hashCode * 8191 + payment_country.hashCode();

    hashCode = hashCode * 8191 + ((isSetPaymentTool()) ? 131071 : 524287);
    if (isSetPaymentTool())
      hashCode = hashCode * 8191 + payment_tool.hashCode();

    hashCode = hashCode * 8191 + ((isSetProvider()) ? 131071 : 524287);
    if (isSetProvider())
      hashCode = hashCode * 8191 + provider.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(PaymentInfo 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(isSetMerchantInfo()).compareTo(other.isSetMerchantInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMerchantInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchant_info, other.merchant_info);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(other.isSetAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, other.amount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCurrency()).compareTo(other.isSetCurrency());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCurrency()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.currency, other.currency);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCardToken()).compareTo(other.isSetCardToken());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCardToken()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.card_token, other.card_token);
      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(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(isSetPaymentSystem()).compareTo(other.isSetPaymentSystem());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPaymentSystem()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_system, other.payment_system);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPaymentCountry()).compareTo(other.isSetPaymentCountry());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPaymentCountry()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_country, other.payment_country);
      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(isSetProvider()).compareTo(other.isSetProvider());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProvider()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.provider, other.provider);
      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("PaymentInfo(");
    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("merchant_info:");
    if (this.merchant_info == null) {
      sb.append("null");
    } else {
      sb.append(this.merchant_info);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("amount:");
    sb.append(this.amount);
    first = false;
    if (!first) sb.append(", ");
    sb.append("currency:");
    if (this.currency == null) {
      sb.append("null");
    } else {
      sb.append(this.currency);
    }
    first = false;
    if (isSetCardToken()) {
      if (!first) sb.append(", ");
      sb.append("card_token:");
      if (this.card_token == null) {
        sb.append("null");
      } else {
        sb.append(this.card_token);
      }
      first = false;
    }
    if (isSetClientInfo()) {
      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 (!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("error:");
    if (this.error == null) {
      sb.append("null");
    } else {
      sb.append(this.error);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("payment_system:");
    if (this.payment_system == null) {
      sb.append("null");
    } else {
      sb.append(this.payment_system);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("payment_country:");
    if (this.payment_country == null) {
      sb.append("null");
    } else {
      sb.append(this.payment_country);
    }
    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("provider:");
    if (this.provider == null) {
      sb.append("null");
    } else {
      sb.append(this.provider);
    }
    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 (merchant_info == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'merchant_info' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'amount' because it's a primitive and you chose the non-beans generator.
    if (currency == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'currency' was not present! Struct: " + toString());
    }
    if (status == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
    }
    if (error == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'error' was not present! Struct: " + toString());
    }
    if (payment_system == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'payment_system' was not present! Struct: " + toString());
    }
    if (payment_country == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'payment_country' 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 (provider == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'provider' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (merchant_info != null) {
      merchant_info.validate();
    }
    if (client_info != null) {
      client_info.validate();
    }
    if (error != null) {
      error.validate();
    }
    if (provider != null) {
      provider.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 PaymentInfoStandardSchemeFactory implements SchemeFactory {
    public PaymentInfoStandardScheme getScheme() {
      return new PaymentInfoStandardScheme();
    }
  }

  private static class PaymentInfoStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, PaymentInfo 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: // MERCHANT_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.merchant_info = new MerchantInfo();
              struct.merchant_info.read(iprot);
              struct.setMerchantInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // AMOUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.amount = iprot.readI64();
              struct.setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CURRENCY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.currency = iprot.readString();
              struct.setCurrencyIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CARD_TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.card_token = iprot.readString();
              struct.setCardTokenIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // 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 8: // 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 9: // 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 10: // PAYMENT_SYSTEM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.payment_system = iprot.readString();
              struct.setPaymentSystemIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // PAYMENT_COUNTRY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.payment_country = iprot.readString();
              struct.setPaymentCountryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // PAYMENT_TOOL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.payment_tool = iprot.readString();
              struct.setPaymentToolIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // PROVIDER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.provider = new ProviderInfo();
              struct.provider.read(iprot);
              struct.setProviderIsSet(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
      if (!struct.isSetAmount()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'amount' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, PaymentInfo 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.merchant_info != null) {
        oprot.writeFieldBegin(MERCHANT_INFO_FIELD_DESC);
        struct.merchant_info.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeI64(struct.amount);
      oprot.writeFieldEnd();
      if (struct.currency != null) {
        oprot.writeFieldBegin(CURRENCY_FIELD_DESC);
        oprot.writeString(struct.currency);
        oprot.writeFieldEnd();
      }
      if (struct.card_token != null) {
        if (struct.isSetCardToken()) {
          oprot.writeFieldBegin(CARD_TOKEN_FIELD_DESC);
          oprot.writeString(struct.card_token);
          oprot.writeFieldEnd();
        }
      }
      if (struct.client_info != null) {
        if (struct.isSetClientInfo()) {
          oprot.writeFieldBegin(CLIENT_INFO_FIELD_DESC);
          struct.client_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) {
        oprot.writeFieldBegin(ERROR_FIELD_DESC);
        struct.error.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.payment_system != null) {
        oprot.writeFieldBegin(PAYMENT_SYSTEM_FIELD_DESC);
        oprot.writeString(struct.payment_system);
        oprot.writeFieldEnd();
      }
      if (struct.payment_country != null) {
        oprot.writeFieldBegin(PAYMENT_COUNTRY_FIELD_DESC);
        oprot.writeString(struct.payment_country);
        oprot.writeFieldEnd();
      }
      if (struct.payment_tool != null) {
        oprot.writeFieldBegin(PAYMENT_TOOL_FIELD_DESC);
        oprot.writeString(struct.payment_tool);
        oprot.writeFieldEnd();
      }
      if (struct.provider != null) {
        oprot.writeFieldBegin(PROVIDER_FIELD_DESC);
        struct.provider.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class PaymentInfoTupleSchemeFactory implements SchemeFactory {
    public PaymentInfoTupleScheme getScheme() {
      return new PaymentInfoTupleScheme();
    }
  }

  private static class PaymentInfoTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, PaymentInfo struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeString(struct.id);
      oprot.writeString(struct.event_time);
      struct.merchant_info.write(oprot);
      oprot.writeI64(struct.amount);
      oprot.writeString(struct.currency);
      oprot.writeI32(struct.status.getValue());
      struct.error.write(oprot);
      oprot.writeString(struct.payment_system);
      oprot.writeString(struct.payment_country);
      oprot.writeString(struct.payment_tool);
      struct.provider.write(oprot);
      BitSet optionals = new BitSet();
      if (struct.isSetCardToken()) {
        optionals.set(0);
      }
      if (struct.isSetClientInfo()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetCardToken()) {
        oprot.writeString(struct.card_token);
      }
      if (struct.isSetClientInfo()) {
        struct.client_info.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, PaymentInfo 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.merchant_info = new MerchantInfo();
      struct.merchant_info.read(iprot);
      struct.setMerchantInfoIsSet(true);
      struct.amount = iprot.readI64();
      struct.setAmountIsSet(true);
      struct.currency = iprot.readString();
      struct.setCurrencyIsSet(true);
      struct.status = com.rbkmoney.damsel.fraudbusters.PaymentStatus.findByValue(iprot.readI32());
      struct.setStatusIsSet(true);
      struct.error = new Error();
      struct.error.read(iprot);
      struct.setErrorIsSet(true);
      struct.payment_system = iprot.readString();
      struct.setPaymentSystemIsSet(true);
      struct.payment_country = iprot.readString();
      struct.setPaymentCountryIsSet(true);
      struct.payment_tool = iprot.readString();
      struct.setPaymentToolIsSet(true);
      struct.provider = new ProviderInfo();
      struct.provider.read(iprot);
      struct.setProviderIsSet(true);
      BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        struct.card_token = iprot.readString();
        struct.setCardTokenIsSet(true);
      }
      if (incoming.get(1)) {
        struct.client_info = new ClientInfo();
        struct.client_info.read(iprot);
        struct.setClientInfoIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy