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
AdjustableDatewhich 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 classAdjustablePayment.MetaThe meta-bean forAdjustablePayment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)doublegetAmount()Gets the amount of the payment.CurrencygetCurrency()Gets the currency of the payment.AdjustableDategetDate()Gets the date that the payment is made.CurrencyAmountgetValue()Gets the amount of the payment.inthashCode()static AdjustablePayment.Metameta()The meta-bean forAdjustablePayment.AdjustablePayment.MetametaBean()AdjustablePaymentnegated()Returns a copy of this payment with the value negated.static AdjustablePaymentof(CurrencyAmount value, AdjustableDate date)Obtains an instance representing an amount where the date is adjustable.static AdjustablePaymentof(CurrencyAmount value, LocalDate date)Obtains an instance representing an amount where the date is fixed.static AdjustablePaymentof(Currency currency, double amount, AdjustableDate date)Obtains an instance representing an amount where the date is adjustable.static AdjustablePaymentof(Currency currency, double amount, LocalDate date)Obtains an instance representing an amount where the date is fixed.static AdjustablePaymentof(Payment payment)Obtains an instance based on aPayment.static AdjustablePaymentofPay(CurrencyAmount value, AdjustableDate date)Obtains an instance representing an amount to be paid where the date is adjustable.static AdjustablePaymentofPay(CurrencyAmount value, LocalDate date)Obtains an instance representing an amount to be paid where the date is fixed.static AdjustablePaymentofReceive(CurrencyAmount value, AdjustableDate date)Obtains an instance representing an amount to be received where the date is adjustable.static AdjustablePaymentofReceive(CurrencyAmount value, LocalDate date)Obtains an instance representing an amount to be received where the date is fixed.Paymentresolve(ReferenceData refData)Resolves the date on this payment, returning a payment with a fixed date.StringtoString()
-
-
-
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
Paymentwith the same amount and resolved date.- Specified by:
resolvein 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:
metaBeanin 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
-
-