public final class AdjustablePayment extends Object implements Resolvable<Payment>, org.joda.beans.ImmutableBean, Serializable
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
AdjustablePayment.Meta
The meta-bean for
AdjustablePayment. |
| Modifier and Type | Method and 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 for
AdjustablePayment. |
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 a
Payment. |
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() |
public static AdjustablePayment of(Currency currency, double amount, LocalDate date)
Whether the payment is pay or receive is determined by the sign of the specified amount.
currency - the currency of the paymentamount - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment of(Currency currency, double amount, AdjustableDate date)
Whether the payment is pay or receive is determined by the sign of the specified amount.
currency - the currency of the paymentamount - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment of(CurrencyAmount value, LocalDate date)
Whether the payment is pay or receive is determined by the sign of the specified amount.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment of(CurrencyAmount value, AdjustableDate date)
Whether the payment is pay or receive is determined by the sign of the specified amount.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment ofPay(CurrencyAmount value, LocalDate date)
The sign of the amount will be normalized to be negative, indicating a payment.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment ofPay(CurrencyAmount value, AdjustableDate date)
The sign of the amount will be normalized to be negative, indicating a payment.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment ofReceive(CurrencyAmount value, LocalDate date)
The sign of the amount will be normalized to be positive, indicating receipt.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment ofReceive(CurrencyAmount value, AdjustableDate date)
The sign of the amount will be normalized to be positive, indicating receipt.
value - the amount of the paymentdate - the date that the payment is madepublic static AdjustablePayment of(Payment payment)
Payment.payment - the fixed paymentpublic Currency getCurrency()
This simply returns getValue().getCurrency().
public double getAmount()
The payment value is signed. A negative value indicates a payment while a positive value indicates receipt.
This simply returns getValue().getAmount().
public Payment resolve(ReferenceData refData)
This returns a Payment with the same amount and resolved date.
resolve in interface Resolvable<Payment>refData - the reference data, used to find the holiday calendarpublic AdjustablePayment negated()
This takes this payment and negates it.
This instance is immutable and unaffected by this method.
public static AdjustablePayment.Meta meta()
AdjustablePayment.public AdjustablePayment.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurrencyAmount getValue()
The amount is signed. A negative value indicates the amount is to be paid while a positive value indicates the amount is received.
public AdjustableDate getDate()
This date should normally be a valid business day.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.