com.stripe.model.Refund Maven / Gradle / Ivy
// Generated by delombok at Wed Nov 28 11:15:52 EST 2018
package com.stripe.model;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import java.util.Map;
public class Refund extends ApiResource implements MetadataStore, HasId {
String id;
String object;
Long amount;
ExpandableField balanceTransaction;
ExpandableField charge;
Long created;
String currency;
String description;
ExpandableField failureBalanceTransaction;
String failureReason;
Map metadata;
String reason;
String receiptNumber;
ExpandableField sourceTransferReversal;
String status;
ExpandableField transferReversal;
//
public String getBalanceTransaction() {
return (this.balanceTransaction != null) ? this.balanceTransaction.getId() : null;
}
public void setBalanceTransaction(String balanceTransactionId) {
this.balanceTransaction = setExpandableFieldId(balanceTransactionId, this.balanceTransaction);
}
public BalanceTransaction getBalanceTransactionObject() {
return (this.balanceTransaction != null) ? this.balanceTransaction.getExpanded() : null;
}
public void setBalanceTransactionObject(BalanceTransaction c) {
this.balanceTransaction = new ExpandableField(c.getId(), c);
}
//
//
public String getCharge() {
return (this.charge != null) ? this.charge.getId() : null;
}
public void setCharge(String chargeId) {
this.charge = setExpandableFieldId(chargeId, this.charge);
}
public Charge getChargeObject() {
return (this.charge != null) ? this.charge.getExpanded() : null;
}
public void setChargeObject(Charge c) {
this.charge = new ExpandableField(c.getId(), c);
}
//
//
public String getFailureBalanceTransaction() {
return (this.failureBalanceTransaction != null) ? this.failureBalanceTransaction.getId() : null;
}
public void setFailureBalanceTransaction(String failureBalanceTransactionId) {
this.failureBalanceTransaction = setExpandableFieldId(failureBalanceTransactionId, this.failureBalanceTransaction);
}
public BalanceTransaction getFailureBalanceTransactionObject() {
return (this.failureBalanceTransaction != null) ? this.failureBalanceTransaction.getExpanded() : null;
}
public void setFailureBalanceTransactionObject(BalanceTransaction c) {
this.failureBalanceTransaction = new ExpandableField(c.getId(), c);
}
//
//
public String getSourceTransferReversal() {
return (this.sourceTransferReversal != null) ? this.sourceTransferReversal.getId() : null;
}
public void setSourceTransferReversal(String sourceTransferReversalId) {
this.sourceTransferReversal = setExpandableFieldId(sourceTransferReversalId, this.sourceTransferReversal);
}
public Reversal getSourceTransferReversalObject() {
return (this.sourceTransferReversal != null) ? this.sourceTransferReversal.getExpanded() : null;
}
public void setSourceTransferReversalObject(Reversal c) {
this.sourceTransferReversal = new ExpandableField(c.getId(), c);
}
//
//
public String getTransferReversal() {
return (this.transferReversal != null) ? this.transferReversal.getId() : null;
}
public void setTransferReversal(String transferReversalId) {
this.transferReversal = setExpandableFieldId(transferReversalId, this.transferReversal);
}
public Reversal getTransferReversalObject() {
return (this.transferReversal != null) ? this.transferReversal.getExpanded() : null;
}
public void setTransferReversalObject(Reversal c) {
this.transferReversal = new ExpandableField(c.getId(), c);
}
//
//
/**
* Create a refund.
*/
public static Refund create(Map params) throws StripeException {
return create(params, null);
}
/**
* Create a refund.
*/
public static Refund create(Map params, RequestOptions options) throws StripeException {
return request(RequestMethod.POST, classUrl(Refund.class), params, Refund.class, options);
}
//
//
/**
* List all refunds.
*/
public static RefundCollection list(Map params) throws StripeException {
return list(params, null);
}
/**
* List all refunds.
*/
public static RefundCollection list(Map params, RequestOptions options) throws StripeException {
return requestCollection(classUrl(Refund.class), params, RefundCollection.class, options);
}
//
//
/**
* Retrieve a refund.
*/
public static Refund retrieve(String id) throws StripeException {
return retrieve(id, null);
}
/**
* Retrieve a refund.
*/
public static Refund retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, null, options);
}
/**
* Retrieve a refund.
*/
public static Refund retrieve(String id, Map params, RequestOptions options) throws StripeException {
return request(RequestMethod.GET, instanceUrl(Refund.class, id), params, Refund.class, options);
}
//
//
/**
* Update a refund.
*/
@Override
public Refund update(Map params) throws StripeException {
return update(params, (RequestOptions) null);
}
/**
* Update a refund.
*/
@Override
public Refund update(Map params, RequestOptions options) throws StripeException {
return request(RequestMethod.POST, instanceUrl(Refund.class, id), params, Refund.class, options);
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getObject() {
return this.object;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getAmount() {
return this.amount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Long getCreated() {
return this.created;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCurrency() {
return this.currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getDescription() {
return this.description;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getFailureReason() {
return this.failureReason;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getReason() {
return this.reason;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getReceiptNumber() {
return this.receiptNumber;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getStatus() {
return this.status;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setId(final String id) {
this.id = id;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setObject(final String object) {
this.object = object;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setAmount(final Long amount) {
this.amount = amount;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCreated(final Long created) {
this.created = created;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCurrency(final String currency) {
this.currency = currency;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setDescription(final String description) {
this.description = description;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setFailureReason(final String failureReason) {
this.failureReason = failureReason;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setMetadata(final Map metadata) {
this.metadata = metadata;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setReason(final String reason) {
this.reason = reason;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setReceiptNumber(final String receiptNumber) {
this.receiptNumber = receiptNumber;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setStatus(final String status) {
this.status = status;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof Refund)) return false;
final Refund other = (Refund) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$id = this.getId();
final java.lang.Object other$id = other.getId();
if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
final java.lang.Object this$object = this.getObject();
final java.lang.Object other$object = other.getObject();
if (this$object == null ? other$object != null : !this$object.equals(other$object)) return false;
final java.lang.Object this$amount = this.getAmount();
final java.lang.Object other$amount = other.getAmount();
if (this$amount == null ? other$amount != null : !this$amount.equals(other$amount)) return false;
final java.lang.Object this$balanceTransaction = this.getBalanceTransaction();
final java.lang.Object other$balanceTransaction = other.getBalanceTransaction();
if (this$balanceTransaction == null ? other$balanceTransaction != null : !this$balanceTransaction.equals(other$balanceTransaction)) return false;
final java.lang.Object this$charge = this.getCharge();
final java.lang.Object other$charge = other.getCharge();
if (this$charge == null ? other$charge != null : !this$charge.equals(other$charge)) return false;
final java.lang.Object this$created = this.getCreated();
final java.lang.Object other$created = other.getCreated();
if (this$created == null ? other$created != null : !this$created.equals(other$created)) return false;
final java.lang.Object this$currency = this.getCurrency();
final java.lang.Object other$currency = other.getCurrency();
if (this$currency == null ? other$currency != null : !this$currency.equals(other$currency)) return false;
final java.lang.Object this$description = this.getDescription();
final java.lang.Object other$description = other.getDescription();
if (this$description == null ? other$description != null : !this$description.equals(other$description)) return false;
final java.lang.Object this$failureBalanceTransaction = this.getFailureBalanceTransaction();
final java.lang.Object other$failureBalanceTransaction = other.getFailureBalanceTransaction();
if (this$failureBalanceTransaction == null ? other$failureBalanceTransaction != null : !this$failureBalanceTransaction.equals(other$failureBalanceTransaction)) return false;
final java.lang.Object this$failureReason = this.getFailureReason();
final java.lang.Object other$failureReason = other.getFailureReason();
if (this$failureReason == null ? other$failureReason != null : !this$failureReason.equals(other$failureReason)) return false;
final java.lang.Object this$metadata = this.getMetadata();
final java.lang.Object other$metadata = other.getMetadata();
if (this$metadata == null ? other$metadata != null : !this$metadata.equals(other$metadata)) return false;
final java.lang.Object this$reason = this.getReason();
final java.lang.Object other$reason = other.getReason();
if (this$reason == null ? other$reason != null : !this$reason.equals(other$reason)) return false;
final java.lang.Object this$receiptNumber = this.getReceiptNumber();
final java.lang.Object other$receiptNumber = other.getReceiptNumber();
if (this$receiptNumber == null ? other$receiptNumber != null : !this$receiptNumber.equals(other$receiptNumber)) return false;
final java.lang.Object this$sourceTransferReversal = this.getSourceTransferReversal();
final java.lang.Object other$sourceTransferReversal = other.getSourceTransferReversal();
if (this$sourceTransferReversal == null ? other$sourceTransferReversal != null : !this$sourceTransferReversal.equals(other$sourceTransferReversal)) return false;
final java.lang.Object this$status = this.getStatus();
final java.lang.Object other$status = other.getStatus();
if (this$status == null ? other$status != null : !this$status.equals(other$status)) return false;
final java.lang.Object this$transferReversal = this.getTransferReversal();
final java.lang.Object other$transferReversal = other.getTransferReversal();
if (this$transferReversal == null ? other$transferReversal != null : !this$transferReversal.equals(other$transferReversal)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof Refund;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $id = this.getId();
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
final java.lang.Object $object = this.getObject();
result = result * PRIME + ($object == null ? 43 : $object.hashCode());
final java.lang.Object $amount = this.getAmount();
result = result * PRIME + ($amount == null ? 43 : $amount.hashCode());
final java.lang.Object $balanceTransaction = this.getBalanceTransaction();
result = result * PRIME + ($balanceTransaction == null ? 43 : $balanceTransaction.hashCode());
final java.lang.Object $charge = this.getCharge();
result = result * PRIME + ($charge == null ? 43 : $charge.hashCode());
final java.lang.Object $created = this.getCreated();
result = result * PRIME + ($created == null ? 43 : $created.hashCode());
final java.lang.Object $currency = this.getCurrency();
result = result * PRIME + ($currency == null ? 43 : $currency.hashCode());
final java.lang.Object $description = this.getDescription();
result = result * PRIME + ($description == null ? 43 : $description.hashCode());
final java.lang.Object $failureBalanceTransaction = this.getFailureBalanceTransaction();
result = result * PRIME + ($failureBalanceTransaction == null ? 43 : $failureBalanceTransaction.hashCode());
final java.lang.Object $failureReason = this.getFailureReason();
result = result * PRIME + ($failureReason == null ? 43 : $failureReason.hashCode());
final java.lang.Object $metadata = this.getMetadata();
result = result * PRIME + ($metadata == null ? 43 : $metadata.hashCode());
final java.lang.Object $reason = this.getReason();
result = result * PRIME + ($reason == null ? 43 : $reason.hashCode());
final java.lang.Object $receiptNumber = this.getReceiptNumber();
result = result * PRIME + ($receiptNumber == null ? 43 : $receiptNumber.hashCode());
final java.lang.Object $sourceTransferReversal = this.getSourceTransferReversal();
result = result * PRIME + ($sourceTransferReversal == null ? 43 : $sourceTransferReversal.hashCode());
final java.lang.Object $status = this.getStatus();
result = result * PRIME + ($status == null ? 43 : $status.hashCode());
final java.lang.Object $transferReversal = this.getTransferReversal();
result = result * PRIME + ($transferReversal == null ? 43 : $transferReversal.hashCode());
return result;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getId() {
return this.id;
}
@Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Map getMetadata() {
return this.metadata;
}
//
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy