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
FxSwapand is an input to the pricers. Applications will typically create aResolvedFxSwapfrom aFxSwapusingFxSwap.resolve(ReferenceData).A
ResolvedFxSwapis 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 classResolvedFxSwap.MetaThe meta-bean forResolvedFxSwap.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ResolvedFxSinglegetFarLeg()Gets the foreign exchange transaction at the later date.ResolvedFxSinglegetNearLeg()Gets the foreign exchange transaction at the earlier date.inthashCode()static ResolvedFxSwap.Metameta()The meta-bean forResolvedFxSwap.ResolvedFxSwap.MetametaBean()static ResolvedFxSwapof(ResolvedFxSingle nearLeg, ResolvedFxSingle farLeg)Creates aResolvedFxSwapfrom two legs.static ResolvedFxSwapofForwardPoints(CurrencyAmount amountCurrency1, Currency currency2, double nearFxRate, double forwardPoints, LocalDate nearDate, LocalDate farDate)Creates aResolvedFxSwapusing forward points.StringtoString()
-
-
-
Method Detail
-
of
public static ResolvedFxSwap of(ResolvedFxSingle nearLeg, ResolvedFxSingle farLeg)
Creates aResolvedFxSwapfrom 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 aResolvedFxSwapusing forward points.The FX rate at the near date is specified as
fxRate. The FX rate at the far date is equal tofxRate + forwardPointsThe 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:
metaBeanin 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
-
-