Class ResolvedFxSingle
- java.lang.Object
-
- com.opengamma.strata.product.fx.ResolvedFxSingle
-
- All Implemented Interfaces:
ResolvedProduct,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ResolvedFxSingle extends Object implements ResolvedProduct, org.joda.beans.ImmutableBean, Serializable
A single FX transaction, resolved for pricing.This is the resolved form of
FxSingleand is an input to the pricers. Applications will typically create aResolvedFxSinglefrom aFxSingleusingFxSingle.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
CurrencyPairfor details of the configuration that determines the ordering.A
ResolvedFxSingleis 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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResolvedFxSingle.MetaThe meta-bean forResolvedFxSingle.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)PaymentgetBaseCurrencyPayment()Gets the payment in the base currency, positive if receiving, negative if paying.PaymentgetCounterCurrencyPayment()Gets the payment in the counter currency, positive if receiving, negative if paying.CurrencyPairgetCurrencyPair()Gets currency pair of the base currency and counter currency.LocalDategetPaymentDate()Returns the date that the transaction settles.CurrencyAmountgetReceiveCurrencyAmount()Gets the currency amount in which the amount is received.inthashCode()ResolvedFxSingleinverse()Returns the inverse transaction.static ResolvedFxSingle.Metameta()The meta-bean forResolvedFxSingle.ResolvedFxSingle.MetametaBean()static ResolvedFxSingleof(CurrencyAmount amount1, CurrencyAmount amount2, LocalDate valueDate)Creates anResolvedFxSinglefrom two amounts and the value date.static ResolvedFxSingleof(CurrencyAmount amountCurrency1, FxRate fxRate, LocalDate paymentDate)Creates anResolvedFxSingleusing a rate.static ResolvedFxSingleof(Payment payment1, Payment payment2)Creates anResolvedFxSinglefrom two equivalent payments in different currencies.StringtoString()
-
-
-
Method Detail
-
of
public static ResolvedFxSingle of(Payment payment1, Payment payment2)
Creates anResolvedFxSinglefrom 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.
- Parameters:
payment1- the first paymentpayment2- the second payment- Returns:
- the resolved foreign exchange transaction
-
of
public static ResolvedFxSingle of(CurrencyAmount amount1, CurrencyAmount amount2, LocalDate valueDate)
Creates anResolvedFxSinglefrom 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.
- Parameters:
amount1- the amount in the first currencyamount2- the amount in the second currencyvalueDate- the value date- Returns:
- the resolved foreign exchange transaction
-
of
public static ResolvedFxSingle of(CurrencyAmount amountCurrency1, FxRate fxRate, LocalDate paymentDate)
Creates anResolvedFxSingleusing 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.
- Parameters:
amountCurrency1- the amount of the near leg in the first currencyfxRate- the near FX ratepaymentDate- date that the FX settles- Returns:
- the resolved foreign exchange transaction
-
getCurrencyPair
public CurrencyPair getCurrencyPair()
Gets currency pair of the base currency and counter currency.This currency pair is conventional, thus indifferent to the direction of FX.
- Returns:
- the currency pair
-
getReceiveCurrencyAmount
public CurrencyAmount getReceiveCurrencyAmount()
Gets the currency amount in which the amount is received.This returns the currency amount whose amount is non-negative. If both are zero, the currency amount of
counterCurrencyPaymentis returned.- Returns:
- the receive currency amount
-
getPaymentDate
public LocalDate getPaymentDate()
Returns the date that the transaction settles.This returns the settlement date of the base currency.
- Returns:
- the value date
-
inverse
public ResolvedFxSingle inverse()
Returns the inverse transaction.The result has the base and counter payments negated.
- Returns:
- the inverse transaction
-
meta
public static ResolvedFxSingle.Meta meta()
The meta-bean forResolvedFxSingle.- Returns:
- the meta-bean, not null
-
metaBean
public ResolvedFxSingle.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getBaseCurrencyPayment
public Payment getBaseCurrencyPayment()
Gets the payment in the base currency, positive if receiving, negative if paying.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.
- Returns:
- the value of the property, not null
-
getCounterCurrencyPayment
public Payment getCounterCurrencyPayment()
Gets the payment in the counter currency, positive if receiving, negative if paying.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.
- Returns:
- the value of the property, not null
-
-