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
FxSingle
and is an input to the pricers. Applications will typically create aResolvedFxSingle
from aFxSingle
usingFxSingle.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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResolvedFxSingle.Meta
The meta-bean forResolvedFxSingle
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 forResolvedFxSingle
.ResolvedFxSingle.Meta
metaBean()
static ResolvedFxSingle
of(CurrencyAmount amount1, CurrencyAmount amount2, LocalDate valueDate)
Creates anResolvedFxSingle
from two amounts and the value date.static ResolvedFxSingle
of(CurrencyAmount amountCurrency1, FxRate fxRate, LocalDate paymentDate)
Creates anResolvedFxSingle
using a rate.static ResolvedFxSingle
of(Payment payment1, Payment payment2)
Creates anResolvedFxSingle
from two equivalent payments in different currencies.String
toString()
-
-
-
Method Detail
-
of
public static ResolvedFxSingle of(Payment payment1, Payment payment2)
Creates anResolvedFxSingle
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.
- 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 anResolvedFxSingle
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.
- 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 anResolvedFxSingle
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.
- 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
counterCurrencyPayment
is 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:
metaBean
in 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
-
-