Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*** Autogenerated by Thrift** DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING*/package in.shop2020.payments;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.util.Arrays;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.apache.thrift.*;import org.apache.thrift.meta_data.*;import org.apache.thrift.protocol.*;public class Refund implements TBase<Refund._Fields>, java.io.Serializable, Cloneable, Comparable<Refund> {private static final TStruct STRUCT_DESC = new TStruct("Refund");private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);private static final TField PAYMENT_ID_FIELD_DESC = new TField("paymentId", TType.I64, (short)2);private static final TField GATEWAY_ID_FIELD_DESC = new TField("gatewayId", TType.I64, (short)3);private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)4);private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)5);private static final TField GATEWAY_TXN_ID_FIELD_DESC = new TField("gatewayTxnId", TType.STRING, (short)6);private static final TField ATTEMPTS_FIELD_DESC = new TField("attempts", TType.I32, (short)7);private static final TField CREATED_AT_FIELD_DESC = new TField("createdAt", TType.I64, (short)8);private static final TField PROCESSED_AT_FIELD_DESC = new TField("processedAt", TType.I64, (short)9);private static final TField ATTRIBUTES_FIELD_DESC = new TField("attributes", TType.LIST, (short)10);private long id;private long paymentId;private long gatewayId;private long orderId;private double amount;private String gatewayTxnId;private int attempts;private long createdAt;private long processedAt;private List<Attribute> attributes;/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */public enum _Fields implements TFieldIdEnum {ID((short)1, "id"),PAYMENT_ID((short)2, "paymentId"),GATEWAY_ID((short)3, "gatewayId"),ORDER_ID((short)4, "orderId"),AMOUNT((short)5, "amount"),GATEWAY_TXN_ID((short)6, "gatewayTxnId"),ATTEMPTS((short)7, "attempts"),CREATED_AT((short)8, "createdAt"),PROCESSED_AT((short)9, "processedAt"),ATTRIBUTES((short)10, "attributes");private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();static {for (_Fields field : EnumSet.allOf(_Fields.class)) {byId.put((int)field._thriftId, field);byName.put(field.getFieldName(), field);}}/*** Find the _Fields constant that matches fieldId, or null if its not found.*/public static _Fields findByThriftId(int fieldId) {return byId.get(fieldId);}/*** 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 assignmentsprivate static final int __ID_ISSET_ID = 0;private static final int __PAYMENTID_ISSET_ID = 1;private static final int __GATEWAYID_ISSET_ID = 2;private static final int __ORDERID_ISSET_ID = 3;private static final int __AMOUNT_ISSET_ID = 4;private static final int __ATTEMPTS_ISSET_ID = 5;private static final int __CREATEDAT_ISSET_ID = 6;private static final int __PROCESSEDAT_ISSET_ID = 7;private BitSet __isset_bit_vector = new BitSet(8);public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.PAYMENT_ID, new FieldMetaData("paymentId", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.GATEWAY_ID, new FieldMetaData("gatewayId", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.DOUBLE)));put(_Fields.GATEWAY_TXN_ID, new FieldMetaData("gatewayTxnId", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.STRING)));put(_Fields.ATTEMPTS, new FieldMetaData("attempts", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I32)));put(_Fields.CREATED_AT, new FieldMetaData("createdAt", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.PROCESSED_AT, new FieldMetaData("processedAt", TFieldRequirementType.DEFAULT,new FieldValueMetaData(TType.I64)));put(_Fields.ATTRIBUTES, new FieldMetaData("attributes", TFieldRequirementType.DEFAULT,new ListMetaData(TType.LIST,new StructMetaData(TType.STRUCT, Attribute.class))));}});static {FieldMetaData.addStructMetaDataMap(Refund.class, metaDataMap);}public Refund() {}public Refund(long id,long paymentId,long gatewayId,long orderId,double amount,String gatewayTxnId,int attempts,long createdAt,long processedAt,List<Attribute> attributes){this();this.id = id;setIdIsSet(true);this.paymentId = paymentId;setPaymentIdIsSet(true);this.gatewayId = gatewayId;setGatewayIdIsSet(true);this.orderId = orderId;setOrderIdIsSet(true);this.amount = amount;setAmountIsSet(true);this.gatewayTxnId = gatewayTxnId;this.attempts = attempts;setAttemptsIsSet(true);this.createdAt = createdAt;setCreatedAtIsSet(true);this.processedAt = processedAt;setProcessedAtIsSet(true);this.attributes = attributes;}/*** Performs a deep copy on <i>other</i>.*/public Refund(Refund other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.id = other.id;this.paymentId = other.paymentId;this.gatewayId = other.gatewayId;this.orderId = other.orderId;this.amount = other.amount;if (other.isSetGatewayTxnId()) {this.gatewayTxnId = other.gatewayTxnId;}this.attempts = other.attempts;this.createdAt = other.createdAt;this.processedAt = other.processedAt;if (other.isSetAttributes()) {List<Attribute> __this__attributes = new ArrayList<Attribute>();for (Attribute other_element : other.attributes) {__this__attributes.add(new Attribute(other_element));}this.attributes = __this__attributes;}}public Refund deepCopy() {return new Refund(this);}@Deprecatedpublic Refund clone() {return new Refund(this);}public long getId() {return this.id;}public Refund setId(long id) {this.id = id;setIdIsSet(true);return this;}public void unsetId() {__isset_bit_vector.clear(__ID_ISSET_ID);}/** Returns true if field id is set (has been asigned a value) and false otherwise */public boolean isSetId() {return __isset_bit_vector.get(__ID_ISSET_ID);}public void setIdIsSet(boolean value) {__isset_bit_vector.set(__ID_ISSET_ID, value);}public long getPaymentId() {return this.paymentId;}public Refund setPaymentId(long paymentId) {this.paymentId = paymentId;setPaymentIdIsSet(true);return this;}public void unsetPaymentId() {__isset_bit_vector.clear(__PAYMENTID_ISSET_ID);}/** Returns true if field paymentId is set (has been asigned a value) and false otherwise */public boolean isSetPaymentId() {return __isset_bit_vector.get(__PAYMENTID_ISSET_ID);}public void setPaymentIdIsSet(boolean value) {__isset_bit_vector.set(__PAYMENTID_ISSET_ID, value);}public long getGatewayId() {return this.gatewayId;}public Refund setGatewayId(long gatewayId) {this.gatewayId = gatewayId;setGatewayIdIsSet(true);return this;}public void unsetGatewayId() {__isset_bit_vector.clear(__GATEWAYID_ISSET_ID);}/** Returns true if field gatewayId is set (has been asigned a value) and false otherwise */public boolean isSetGatewayId() {return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);}public void setGatewayIdIsSet(boolean value) {__isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);}public long getOrderId() {return this.orderId;}public Refund setOrderId(long orderId) {this.orderId = orderId;setOrderIdIsSet(true);return this;}public void unsetOrderId() {__isset_bit_vector.clear(__ORDERID_ISSET_ID);}/** Returns true if field orderId is set (has been asigned a value) and false otherwise */public boolean isSetOrderId() {return __isset_bit_vector.get(__ORDERID_ISSET_ID);}public void setOrderIdIsSet(boolean value) {__isset_bit_vector.set(__ORDERID_ISSET_ID, value);}public double getAmount() {return this.amount;}public Refund setAmount(double amount) {this.amount = amount;setAmountIsSet(true);return this;}public void unsetAmount() {__isset_bit_vector.clear(__AMOUNT_ISSET_ID);}/** Returns true if field amount is set (has been asigned a value) and false otherwise */public boolean isSetAmount() {return __isset_bit_vector.get(__AMOUNT_ISSET_ID);}public void setAmountIsSet(boolean value) {__isset_bit_vector.set(__AMOUNT_ISSET_ID, value);}public String getGatewayTxnId() {return this.gatewayTxnId;}public Refund setGatewayTxnId(String gatewayTxnId) {this.gatewayTxnId = gatewayTxnId;return this;}public void unsetGatewayTxnId() {this.gatewayTxnId = null;}/** Returns true if field gatewayTxnId is set (has been asigned a value) and false otherwise */public boolean isSetGatewayTxnId() {return this.gatewayTxnId != null;}public void setGatewayTxnIdIsSet(boolean value) {if (!value) {this.gatewayTxnId = null;}}public int getAttempts() {return this.attempts;}public Refund setAttempts(int attempts) {this.attempts = attempts;setAttemptsIsSet(true);return this;}public void unsetAttempts() {__isset_bit_vector.clear(__ATTEMPTS_ISSET_ID);}/** Returns true if field attempts is set (has been asigned a value) and false otherwise */public boolean isSetAttempts() {return __isset_bit_vector.get(__ATTEMPTS_ISSET_ID);}public void setAttemptsIsSet(boolean value) {__isset_bit_vector.set(__ATTEMPTS_ISSET_ID, value);}public long getCreatedAt() {return this.createdAt;}public Refund setCreatedAt(long createdAt) {this.createdAt = createdAt;setCreatedAtIsSet(true);return this;}public void unsetCreatedAt() {__isset_bit_vector.clear(__CREATEDAT_ISSET_ID);}/** Returns true if field createdAt is set (has been asigned a value) and false otherwise */public boolean isSetCreatedAt() {return __isset_bit_vector.get(__CREATEDAT_ISSET_ID);}public void setCreatedAtIsSet(boolean value) {__isset_bit_vector.set(__CREATEDAT_ISSET_ID, value);}public long getProcessedAt() {return this.processedAt;}public Refund setProcessedAt(long processedAt) {this.processedAt = processedAt;setProcessedAtIsSet(true);return this;}public void unsetProcessedAt() {__isset_bit_vector.clear(__PROCESSEDAT_ISSET_ID);}/** Returns true if field processedAt is set (has been asigned a value) and false otherwise */public boolean isSetProcessedAt() {return __isset_bit_vector.get(__PROCESSEDAT_ISSET_ID);}public void setProcessedAtIsSet(boolean value) {__isset_bit_vector.set(__PROCESSEDAT_ISSET_ID, value);}public int getAttributesSize() {return (this.attributes == null) ? 0 : this.attributes.size();}public java.util.Iterator<Attribute> getAttributesIterator() {return (this.attributes == null) ? null : this.attributes.iterator();}public void addToAttributes(Attribute elem) {if (this.attributes == null) {this.attributes = new ArrayList<Attribute>();}this.attributes.add(elem);}public List<Attribute> getAttributes() {return this.attributes;}public Refund setAttributes(List<Attribute> attributes) {this.attributes = attributes;return this;}public void unsetAttributes() {this.attributes = null;}/** Returns true if field attributes is set (has been asigned a value) and false otherwise */public boolean isSetAttributes() {return this.attributes != null;}public void setAttributesIsSet(boolean value) {if (!value) {this.attributes = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case ID:if (value == null) {unsetId();} else {setId((Long)value);}break;case PAYMENT_ID:if (value == null) {unsetPaymentId();} else {setPaymentId((Long)value);}break;case GATEWAY_ID:if (value == null) {unsetGatewayId();} else {setGatewayId((Long)value);}break;case ORDER_ID:if (value == null) {unsetOrderId();} else {setOrderId((Long)value);}break;case AMOUNT:if (value == null) {unsetAmount();} else {setAmount((Double)value);}break;case GATEWAY_TXN_ID:if (value == null) {unsetGatewayTxnId();} else {setGatewayTxnId((String)value);}break;case ATTEMPTS:if (value == null) {unsetAttempts();} else {setAttempts((Integer)value);}break;case CREATED_AT:if (value == null) {unsetCreatedAt();} else {setCreatedAt((Long)value);}break;case PROCESSED_AT:if (value == null) {unsetProcessedAt();} else {setProcessedAt((Long)value);}break;case ATTRIBUTES:if (value == null) {unsetAttributes();} else {setAttributes((List<Attribute>)value);}break;}}public void setFieldValue(int fieldID, Object value) {setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);}public Object getFieldValue(_Fields field) {switch (field) {case ID:return new Long(getId());case PAYMENT_ID:return new Long(getPaymentId());case GATEWAY_ID:return new Long(getGatewayId());case ORDER_ID:return new Long(getOrderId());case AMOUNT:return new Double(getAmount());case GATEWAY_TXN_ID:return getGatewayTxnId();case ATTEMPTS:return new Integer(getAttempts());case CREATED_AT:return new Long(getCreatedAt());case PROCESSED_AT:return new Long(getProcessedAt());case ATTRIBUTES:return getAttributes();}throw new IllegalStateException();}public Object getFieldValue(int fieldId) {return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));}/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */public boolean isSet(_Fields field) {switch (field) {case ID:return isSetId();case PAYMENT_ID:return isSetPaymentId();case GATEWAY_ID:return isSetGatewayId();case ORDER_ID:return isSetOrderId();case AMOUNT:return isSetAmount();case GATEWAY_TXN_ID:return isSetGatewayTxnId();case ATTEMPTS:return isSetAttempts();case CREATED_AT:return isSetCreatedAt();case PROCESSED_AT:return isSetProcessedAt();case ATTRIBUTES:return isSetAttributes();}throw new IllegalStateException();}public boolean isSet(int fieldID) {return isSet(_Fields.findByThriftIdOrThrow(fieldID));}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof Refund)return this.equals((Refund)that);return false;}public boolean equals(Refund that) {if (that == null)return false;boolean this_present_id = true;boolean that_present_id = true;if (this_present_id || that_present_id) {if (!(this_present_id && that_present_id))return false;if (this.id != that.id)return false;}boolean this_present_paymentId = true;boolean that_present_paymentId = true;if (this_present_paymentId || that_present_paymentId) {if (!(this_present_paymentId && that_present_paymentId))return false;if (this.paymentId != that.paymentId)return false;}boolean this_present_gatewayId = true;boolean that_present_gatewayId = true;if (this_present_gatewayId || that_present_gatewayId) {if (!(this_present_gatewayId && that_present_gatewayId))return false;if (this.gatewayId != that.gatewayId)return false;}boolean this_present_orderId = true;boolean that_present_orderId = true;if (this_present_orderId || that_present_orderId) {if (!(this_present_orderId && that_present_orderId))return false;if (this.orderId != that.orderId)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_gatewayTxnId = true && this.isSetGatewayTxnId();boolean that_present_gatewayTxnId = true && that.isSetGatewayTxnId();if (this_present_gatewayTxnId || that_present_gatewayTxnId) {if (!(this_present_gatewayTxnId && that_present_gatewayTxnId))return false;if (!this.gatewayTxnId.equals(that.gatewayTxnId))return false;}boolean this_present_attempts = true;boolean that_present_attempts = true;if (this_present_attempts || that_present_attempts) {if (!(this_present_attempts && that_present_attempts))return false;if (this.attempts != that.attempts)return false;}boolean this_present_createdAt = true;boolean that_present_createdAt = true;if (this_present_createdAt || that_present_createdAt) {if (!(this_present_createdAt && that_present_createdAt))return false;if (this.createdAt != that.createdAt)return false;}boolean this_present_processedAt = true;boolean that_present_processedAt = true;if (this_present_processedAt || that_present_processedAt) {if (!(this_present_processedAt && that_present_processedAt))return false;if (this.processedAt != that.processedAt)return false;}boolean this_present_attributes = true && this.isSetAttributes();boolean that_present_attributes = true && that.isSetAttributes();if (this_present_attributes || that_present_attributes) {if (!(this_present_attributes && that_present_attributes))return false;if (!this.attributes.equals(that.attributes))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(Refund other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;Refund typedOther = (Refund)other;lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(id, typedOther.id);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetPaymentId()).compareTo(isSetPaymentId());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(paymentId, typedOther.paymentId);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(isSetGatewayId());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(gatewayId, typedOther.gatewayId);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetGatewayTxnId()).compareTo(isSetGatewayTxnId());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(gatewayTxnId, typedOther.gatewayTxnId);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetAttempts()).compareTo(isSetAttempts());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(attempts, typedOther.attempts);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetCreatedAt()).compareTo(isSetCreatedAt());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(createdAt, typedOther.createdAt);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetProcessedAt()).compareTo(isSetProcessedAt());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(processedAt, typedOther.processedAt);if (lastComparison != 0) {return lastComparison;}lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(isSetAttributes());if (lastComparison != 0) {return lastComparison;}lastComparison = TBaseHelper.compareTo(attributes, typedOther.attributes);if (lastComparison != 0) {return lastComparison;}return 0;}public void read(TProtocol iprot) throws TException {TField field;iprot.readStructBegin();while (true){field = iprot.readFieldBegin();if (field.type == TType.STOP) {break;}_Fields fieldId = _Fields.findByThriftId(field.id);if (fieldId == null) {TProtocolUtil.skip(iprot, field.type);} else {switch (fieldId) {case ID:if (field.type == TType.I64) {this.id = iprot.readI64();setIdIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case PAYMENT_ID:if (field.type == TType.I64) {this.paymentId = iprot.readI64();setPaymentIdIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case GATEWAY_ID:if (field.type == TType.I64) {this.gatewayId = iprot.readI64();setGatewayIdIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case ORDER_ID:if (field.type == TType.I64) {this.orderId = iprot.readI64();setOrderIdIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case AMOUNT:if (field.type == TType.DOUBLE) {this.amount = iprot.readDouble();setAmountIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case GATEWAY_TXN_ID:if (field.type == TType.STRING) {this.gatewayTxnId = iprot.readString();} else {TProtocolUtil.skip(iprot, field.type);}break;case ATTEMPTS:if (field.type == TType.I32) {this.attempts = iprot.readI32();setAttemptsIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case CREATED_AT:if (field.type == TType.I64) {this.createdAt = iprot.readI64();setCreatedAtIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case PROCESSED_AT:if (field.type == TType.I64) {this.processedAt = iprot.readI64();setProcessedAtIsSet(true);} else {TProtocolUtil.skip(iprot, field.type);}break;case ATTRIBUTES:if (field.type == TType.LIST) {{TList _list8 = iprot.readListBegin();this.attributes = new ArrayList<Attribute>(_list8.size);for (int _i9 = 0; _i9 < _list8.size; ++_i9){Attribute _elem10;_elem10 = new Attribute();_elem10.read(iprot);this.attributes.add(_elem10);}iprot.readListEnd();}} else {TProtocolUtil.skip(iprot, field.type);}break;}iprot.readFieldEnd();}}iprot.readStructEnd();validate();}public void write(TProtocol oprot) throws TException {validate();oprot.writeStructBegin(STRUCT_DESC);oprot.writeFieldBegin(ID_FIELD_DESC);oprot.writeI64(this.id);oprot.writeFieldEnd();oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);oprot.writeI64(this.paymentId);oprot.writeFieldEnd();oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);oprot.writeI64(this.gatewayId);oprot.writeFieldEnd();oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);oprot.writeI64(this.orderId);oprot.writeFieldEnd();oprot.writeFieldBegin(AMOUNT_FIELD_DESC);oprot.writeDouble(this.amount);oprot.writeFieldEnd();if (this.gatewayTxnId != null) {oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);oprot.writeString(this.gatewayTxnId);oprot.writeFieldEnd();}oprot.writeFieldBegin(ATTEMPTS_FIELD_DESC);oprot.writeI32(this.attempts);oprot.writeFieldEnd();oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);oprot.writeI64(this.createdAt);oprot.writeFieldEnd();oprot.writeFieldBegin(PROCESSED_AT_FIELD_DESC);oprot.writeI64(this.processedAt);oprot.writeFieldEnd();if (this.attributes != null) {oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);{oprot.writeListBegin(new TList(TType.STRUCT, this.attributes.size()));for (Attribute _iter11 : this.attributes){_iter11.write(oprot);}oprot.writeListEnd();}oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("Refund(");boolean first = true;sb.append("id:");sb.append(this.id);first = false;if (!first) sb.append(", ");sb.append("paymentId:");sb.append(this.paymentId);first = false;if (!first) sb.append(", ");sb.append("gatewayId:");sb.append(this.gatewayId);first = false;if (!first) sb.append(", ");sb.append("orderId:");sb.append(this.orderId);first = false;if (!first) sb.append(", ");sb.append("amount:");sb.append(this.amount);first = false;if (!first) sb.append(", ");sb.append("gatewayTxnId:");if (this.gatewayTxnId == null) {sb.append("null");} else {sb.append(this.gatewayTxnId);}first = false;if (!first) sb.append(", ");sb.append("attempts:");sb.append(this.attempts);first = false;if (!first) sb.append(", ");sb.append("createdAt:");sb.append(this.createdAt);first = false;if (!first) sb.append(", ");sb.append("processedAt:");sb.append(this.processedAt);first = false;if (!first) sb.append(", ");sb.append("attributes:");if (this.attributes == null) {sb.append("null");} else {sb.append(this.attributes);}first = false;sb.append(")");return sb.toString();}public void validate() throws TException {// check for required fields}}