Class ResolvedFxSwap
- java.lang.Object
-
- com.opengamma.strata.product.fx.ResolvedFxSwap
-
- All Implemented Interfaces:
ResolvedProduct
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ResolvedFxSwap extends Object implements ResolvedProduct, org.joda.beans.ImmutableBean, Serializable
An FX Swap, resolved for pricing.This is the resolved form of
FxSwap
and is an input to the pricers. Applications will typically create aResolvedFxSwap
from aFxSwap
usingFxSwap.resolve(ReferenceData)
.A
ResolvedFxSwap
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
ResolvedFxSwap.Meta
The meta-bean forResolvedFxSwap
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
ResolvedFxSingle
getFarLeg()
Gets the foreign exchange transaction at the later date.ResolvedFxSingle
getNearLeg()
Gets the foreign exchange transaction at the earlier date.int
hashCode()
static ResolvedFxSwap.Meta
meta()
The meta-bean forResolvedFxSwap
.ResolvedFxSwap.Meta
metaBean()
static ResolvedFxSwap
of(ResolvedFxSingle nearLeg, ResolvedFxSingle farLeg)
Creates aResolvedFxSwap
from two legs.static ResolvedFxSwap
ofForwardPoints(CurrencyAmount amountCurrency1, Currency currency2, double nearFxRate, double forwardPoints, LocalDate nearDate, LocalDate farDate)
Creates aResolvedFxSwap
using forward points.String
toString()
-
-
-
Method Detail
-
of
public static ResolvedFxSwap of(ResolvedFxSingle nearLeg, ResolvedFxSingle farLeg)
Creates aResolvedFxSwap
from two legs.The transactions must be passed in with payment dates in the correct order. The currency pair of each leg must match and have amounts flowing in opposite directions.
- Parameters:
nearLeg
- the earlier legfarLeg
- the later leg- Returns:
- the resolved FX swap
-
ofForwardPoints
public static ResolvedFxSwap ofForwardPoints(CurrencyAmount amountCurrency1, Currency currency2, double nearFxRate, double forwardPoints, LocalDate nearDate, LocalDate farDate)
Creates aResolvedFxSwap
using forward points.The FX rate at the near date is specified as
fxRate
. The FX rate at the far date is equal tofxRate + forwardPoints
The two currencies must not be equal. The near date must be before the far date. Conventions will be used to determine the base and counter currency.
- Parameters:
amountCurrency1
- the amount of the near leg in the first currencycurrency2
- the second currencynearFxRate
- the near FX rate, where(1.0 * amountCurrency1 = fxRate * amountCurrency2)
forwardPoints
- the forward points, where the far FX rate is(fxRate + forwardPoints)
nearDate
- the near value datefarDate
- the far value date- Returns:
- the resolved FX swap
-
meta
public static ResolvedFxSwap.Meta meta()
The meta-bean forResolvedFxSwap
.- Returns:
- the meta-bean, not null
-
metaBean
public ResolvedFxSwap.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getNearLeg
public ResolvedFxSingle getNearLeg()
Gets the foreign exchange transaction at the earlier date.This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be before that of the far leg.
- Returns:
- the value of the property, not null
-
getFarLeg
public ResolvedFxSingle getFarLeg()
Gets the foreign exchange transaction at the later date.This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be after that of the near leg.
- Returns:
- the value of the property, not null
-
-