Class AdjustablePayment
- java.lang.Object
-
- com.opengamma.strata.basics.currency.AdjustablePayment
-
- All Implemented Interfaces:
Resolvable<Payment>
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class AdjustablePayment extends Object implements Resolvable<Payment>, org.joda.beans.ImmutableBean, Serializable
A single payment of a known amount on a date, with business day adjustment rules.This class represents a payment, where the payment date and amount are known. The date is specified using an
AdjustableDate
which allows holidays and weekends to be handled. A negative value indicates the amount is to be paid while a positive value indicates the amount is received.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdjustablePayment.Meta
The meta-bean forAdjustablePayment
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getAmount()
Gets the amount of the payment.Currency
getCurrency()
Gets the currency of the payment.AdjustableDate
getDate()
Gets the date that the payment is made.CurrencyAmount
getValue()
Gets the amount of the payment.int
hashCode()
static AdjustablePayment.Meta
meta()
The meta-bean forAdjustablePayment
.AdjustablePayment.Meta
metaBean()
AdjustablePayment
negated()
Returns a copy of this payment with the value negated.static AdjustablePayment
of(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount where the date is adjustable.static AdjustablePayment
of(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount where the date is fixed.static AdjustablePayment
of(Currency currency, double amount, AdjustableDate date)
Obtains an instance representing an amount where the date is adjustable.static AdjustablePayment
of(Currency currency, double amount, LocalDate date)
Obtains an instance representing an amount where the date is fixed.static AdjustablePayment
of(Payment payment)
Obtains an instance based on aPayment
.static AdjustablePayment
ofPay(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount to be paid where the date is adjustable.static AdjustablePayment
ofPay(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount to be paid where the date is fixed.static AdjustablePayment
ofReceive(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount to be received where the date is adjustable.static AdjustablePayment
ofReceive(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount to be received where the date is fixed.Payment
resolve(ReferenceData refData)
Resolves the date on this payment, returning a payment with a fixed date.String
toString()
-
-
-
Method Detail
-
of
public static AdjustablePayment of(Currency currency, double amount, LocalDate date)
Obtains an instance representing an amount where the date is fixed.Whether the payment is pay or receive is determined by the sign of the specified amount.
- Parameters:
currency
- the currency of the paymentamount
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
of
public static AdjustablePayment of(Currency currency, double amount, AdjustableDate date)
Obtains an instance representing an amount where the date is adjustable.Whether the payment is pay or receive is determined by the sign of the specified amount.
- Parameters:
currency
- the currency of the paymentamount
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
of
public static AdjustablePayment of(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount where the date is fixed.Whether the payment is pay or receive is determined by the sign of the specified amount.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
of
public static AdjustablePayment of(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount where the date is adjustable.Whether the payment is pay or receive is determined by the sign of the specified amount.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
ofPay
public static AdjustablePayment ofPay(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount to be paid where the date is fixed.The sign of the amount will be normalized to be negative, indicating a payment.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
ofPay
public static AdjustablePayment ofPay(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount to be paid where the date is adjustable.The sign of the amount will be normalized to be negative, indicating a payment.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
ofReceive
public static AdjustablePayment ofReceive(CurrencyAmount value, LocalDate date)
Obtains an instance representing an amount to be received where the date is fixed.The sign of the amount will be normalized to be positive, indicating receipt.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
ofReceive
public static AdjustablePayment ofReceive(CurrencyAmount value, AdjustableDate date)
Obtains an instance representing an amount to be received where the date is adjustable.The sign of the amount will be normalized to be positive, indicating receipt.
- Parameters:
value
- the amount of the paymentdate
- the date that the payment is made- Returns:
- the adjustable payment instance
-
of
public static AdjustablePayment of(Payment payment)
Obtains an instance based on aPayment
.- Parameters:
payment
- the fixed payment- Returns:
- the adjustable payment instance
-
getCurrency
public Currency getCurrency()
Gets the currency of the payment.This simply returns
getValue().getCurrency()
.- Returns:
- the currency of the payment
-
getAmount
public double getAmount()
Gets the amount of the payment.The payment value is signed. A negative value indicates a payment while a positive value indicates receipt.
This simply returns
getValue().getAmount()
.- Returns:
- the amount of the payment
-
resolve
public Payment resolve(ReferenceData refData)
Resolves the date on this payment, returning a payment with a fixed date.This returns a
Payment
with the same amount and resolved date.- Specified by:
resolve
in interfaceResolvable<Payment>
- Parameters:
refData
- the reference data, used to find the holiday calendar- Returns:
- the resolved payment
-
negated
public AdjustablePayment negated()
Returns a copy of this payment with the value negated.This takes this payment and negates it.
This instance is immutable and unaffected by this method.
- Returns:
- a payment based on this with the value negated
-
meta
public static AdjustablePayment.Meta meta()
The meta-bean forAdjustablePayment
.- Returns:
- the meta-bean, not null
-
metaBean
public AdjustablePayment.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getValue
public CurrencyAmount getValue()
Gets the amount of the payment.The amount is signed. A negative value indicates the amount is to be paid while a positive value indicates the amount is received.
- Returns:
- the value of the property, not null
-
getDate
public AdjustableDate getDate()
Gets the date that the payment is made.This date should normally be a valid business day.
- Returns:
- the value of the property, not null
-
-