public final class ResolvedFxSingle extends Object implements ResolvedProduct, org.joda.beans.ImmutableBean, Serializable
This is the resolved form of FxSingle and is an input to the pricers.
Applications will typically create a ResolvedFxSingle from a FxSingle
using FxSingle.resolve(ReferenceData).
The two payments are identified as the base and counter currencies in a standardized currency pair.
For example, a EUR/USD exchange always has EUR as the base payment and USD as the counter payment.
See CurrencyPair for details of the configuration that determines the ordering.
A ResolvedFxSingle is bound to data that changes over time, such as holiday calendars.
If the data changes, such as the addition of a new holiday, the resolved form will not be updated.
Care must be taken when placing the resolved form in a cache or persistence layer.
| Modifier and Type | Class and Description |
|---|---|
static class |
ResolvedFxSingle.Meta
The meta-bean for
ResolvedFxSingle. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Payment |
getBaseCurrencyPayment()
Gets the payment in the base currency, positive if receiving, negative if paying.
|
Payment |
getCounterCurrencyPayment()
Gets the payment in the counter currency, positive if receiving, negative if paying.
|
CurrencyPair |
getCurrencyPair()
Gets currency pair of the base currency and counter currency.
|
LocalDate |
getPaymentDate()
Returns the date that the transaction settles.
|
CurrencyAmount |
getReceiveCurrencyAmount()
Gets the currency amount in which the amount is received.
|
int |
hashCode() |
ResolvedFxSingle |
inverse()
Returns the inverse transaction.
|
static ResolvedFxSingle.Meta |
meta()
The meta-bean for
ResolvedFxSingle. |
ResolvedFxSingle.Meta |
metaBean() |
static ResolvedFxSingle |
of(CurrencyAmount amount1,
CurrencyAmount amount2,
LocalDate valueDate)
Creates an
ResolvedFxSingle from two amounts and the value date. |
static ResolvedFxSingle |
of(CurrencyAmount amountCurrency1,
FxRate fxRate,
LocalDate paymentDate)
Creates an
ResolvedFxSingle using a rate. |
static ResolvedFxSingle |
of(Payment payment1,
Payment payment2)
Creates an
ResolvedFxSingle from two equivalent payments in different currencies. |
String |
toString() |
public static ResolvedFxSingle of(Payment payment1, Payment payment2)
ResolvedFxSingle from two equivalent payments in different currencies.
The payments must be of the correct type, one pay and one receive. The currencies of the payments must differ.
This factory identifies the currency pair of the exchange and assigns the payments to match the base or counter currency of the standardized currency pair. For example, a EUR/USD exchange always has EUR as the base payment and USD as the counter payment.
payment1 - the first paymentpayment2 - the second paymentpublic static ResolvedFxSingle of(CurrencyAmount amount1, CurrencyAmount amount2, LocalDate valueDate)
ResolvedFxSingle from two amounts and the value date.
The amounts must be of the correct type, one pay and one receive. The currencies of the payments must differ.
This factory identifies the currency pair of the exchange and assigns the payments to match the base or counter currency of the standardized currency pair. For example, a EUR/USD exchange always has EUR as the base payment and USD as the counter payment.
amount1 - the amount in the first currencyamount2 - the amount in the second currencyvalueDate - the value datepublic static ResolvedFxSingle of(CurrencyAmount amountCurrency1, FxRate fxRate, LocalDate paymentDate)
ResolvedFxSingle using a rate.
This create an FX specifying a value date, notional in one currency, the second currency and the FX rate between the two. The currencies of the payments must differ.
This factory identifies the currency pair of the exchange and assigns the payments to match the base or counter currency of the standardized currency pair. For example, a EUR/USD exchange always has EUR as the base payment and USD as the counter payment.
No payment date adjustments apply.
amountCurrency1 - the amount of the near leg in the first currencyfxRate - the near FX ratepaymentDate - date that the FX settlespublic CurrencyPair getCurrencyPair()
This currency pair is conventional, thus indifferent to the direction of FX.
public CurrencyAmount getReceiveCurrencyAmount()
This returns the currency amount whose amount is non-negative.
If both are zero, the currency amount of counterCurrencyPayment is returned.
public LocalDate getPaymentDate()
This returns the settlement date of the base currency.
public ResolvedFxSingle inverse()
The result has the base and counter payments negated.
public static ResolvedFxSingle.Meta meta()
ResolvedFxSingle.public ResolvedFxSingle.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Payment getBaseCurrencyPayment()
The payment amount is signed. A positive amount indicates the payment is to be received. A negative amount indicates the payment is to be paid.
public Payment getCounterCurrencyPayment()
The payment amount is signed. A positive amount indicates the payment is to be received. A negative amount indicates the payment is to be paid.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.