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

com.paypal.api.payments.Amount Maven / Gradle / Ivy

There is a newer version: 1.14.0
Show newest version
// Generated by delombok at Tue Jan 31 13:36:37 CST 2017
package com.paypal.api.payments;

import com.paypal.base.rest.PayPalModel;

public class Amount extends PayPalModel {
	/**
	 * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
	 */
	private String currency;
	/**
	 * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
	 */
	private String total;
	/**
	 * Additional details of the payment amount.
	 */
	private Details details;

	/**
	 * Default Constructor
	 */
	public Amount() {
	}

	/**
	 * Parameterized Constructor
	 */
	public Amount(String currency, String total) {
		this.currency = currency;
		this.total = total;
	}

	/**
	 * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
	 */
	@java.lang.SuppressWarnings("all")
	public String getCurrency() {
		return this.currency;
	}

	/**
	 * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
	 */
	@java.lang.SuppressWarnings("all")
	public String getTotal() {
		return this.total;
	}

	/**
	 * Additional details of the payment amount.
	 */
	@java.lang.SuppressWarnings("all")
	public Details getDetails() {
		return this.details;
	}

	/**
	 * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
	 * @return this
	 */
	@java.lang.SuppressWarnings("all")
	public Amount setCurrency(final String currency) {
		this.currency = currency;
		return this;
	}

	/**
	 * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
	 * @return this
	 */
	@java.lang.SuppressWarnings("all")
	public Amount setTotal(final String total) {
		this.total = total;
		return this;
	}

	/**
	 * Additional details of the payment amount.
	 * @return this
	 */
	@java.lang.SuppressWarnings("all")
	public Amount setDetails(final Details details) {
		this.details = details;
		return this;
	}

	@java.lang.Override
	@java.lang.SuppressWarnings("all")
	public boolean equals(final java.lang.Object o) {
		if (o == this) return true;
		if (!(o instanceof Amount)) return false;
		final Amount other = (Amount) o;
		if (!other.canEqual((java.lang.Object) this)) return false;
		if (!super.equals(o)) 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$total = this.getTotal();
		final java.lang.Object other$total = other.getTotal();
		if (this$total == null ? other$total != null : !this$total.equals(other$total)) return false;
		final java.lang.Object this$details = this.getDetails();
		final java.lang.Object other$details = other.getDetails();
		if (this$details == null ? other$details != null : !this$details.equals(other$details)) return false;
		return true;
	}

	@java.lang.SuppressWarnings("all")
	protected boolean canEqual(final java.lang.Object other) {
		return other instanceof Amount;
	}

	@java.lang.Override
	@java.lang.SuppressWarnings("all")
	public int hashCode() {
		final int PRIME = 59;
		int result = 1;
		result = result * PRIME + super.hashCode();
		final java.lang.Object $currency = this.getCurrency();
		result = result * PRIME + ($currency == null ? 43 : $currency.hashCode());
		final java.lang.Object $total = this.getTotal();
		result = result * PRIME + ($total == null ? 43 : $total.hashCode());
		final java.lang.Object $details = this.getDetails();
		result = result * PRIME + ($details == null ? 43 : $details.hashCode());
		return result;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy