Package com.opengamma.strata.market
Class FxRateShifts
- java.lang.Object
-
- com.opengamma.strata.market.FxRateShifts
-
- All Implemented Interfaces:
ScenarioPerturbation<FxRate>
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class FxRateShifts extends Object implements ScenarioPerturbation<FxRate>, org.joda.beans.ImmutableBean, Serializable
A perturbation that applies different shifts to an FX rate.This class contains shifts, each of which is associated with a scenario and applied to an FX rate based on the shift type.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FxRateShifts.Meta
The meta-bean forFxRateShifts
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MarketDataBox<FxRate>
applyTo(MarketDataBox<FxRate> marketData, ReferenceData refData)
Applies this perturbation to the market data in a box, returning a box containing new, modified data.boolean
equals(Object obj)
CurrencyPair
getCurrencyPair()
Gets the currency pair for which the shifts are applied.Class<FxRate>
getMarketDataType()
Returns the market data type that the perturbation changes.int
getScenarioCount()
Returns the number of scenarios for which this perturbation generates data.DoubleArray
getShiftAmount()
Gets the shifts to apply toFxRate
.ShiftType
getShiftType()
Gets the type of shift applied to the FX rate.int
hashCode()
static FxRateShifts.Meta
meta()
The meta-bean forFxRateShifts
.FxRateShifts.Meta
metaBean()
static FxRateShifts
of(ShiftType shiftType, DoubleArray shiftAmount, CurrencyPair currencyPair)
Creates an instance.String
toString()
-
-
-
Method Detail
-
of
public static FxRateShifts of(ShiftType shiftType, DoubleArray shiftAmount, CurrencyPair currencyPair)
Creates an instance.- Parameters:
shiftType
- the shift typeshiftAmount
- the shift amountcurrencyPair
- the currency pair- Returns:
- the instance
-
applyTo
public MarketDataBox<FxRate> applyTo(MarketDataBox<FxRate> marketData, ReferenceData refData)
Description copied from interface:ScenarioPerturbation
Applies this perturbation to the market data in a box, returning a box containing new, modified data.The original market data must not be altered. Instead a perturbed copy must be returned.
- Specified by:
applyTo
in interfaceScenarioPerturbation<FxRate>
- Parameters:
marketData
- the market data to perturbrefData
- the reference data- Returns:
- new market data derived by applying the perturbation to the input data
-
getScenarioCount
public int getScenarioCount()
Description copied from interface:ScenarioPerturbation
Returns the number of scenarios for which this perturbation generates data.- Specified by:
getScenarioCount
in interfaceScenarioPerturbation<FxRate>
- Returns:
- the number of scenarios for which this perturbation generates data
-
getMarketDataType
public Class<FxRate> getMarketDataType()
Description copied from interface:ScenarioPerturbation
Returns the market data type that the perturbation changes.- Specified by:
getMarketDataType
in interfaceScenarioPerturbation<FxRate>
- Returns:
- the data type
-
meta
public static FxRateShifts.Meta meta()
The meta-bean forFxRateShifts
.- Returns:
- the meta-bean, not null
-
metaBean
public FxRateShifts.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getShiftType
public ShiftType getShiftType()
Gets the type of shift applied to the FX rate.- Returns:
- the value of the property, not null
-
getShiftAmount
public DoubleArray getShiftAmount()
Gets the shifts to apply toFxRate
.Each element in the array corresponds to each scenario.
- Returns:
- the value of the property, not null
-
getCurrencyPair
public CurrencyPair getCurrencyPair()
Gets the currency pair for which the shifts are applied.This also defines the direction of the FX rate to be shifted.
- Returns:
- the value of the property, not null
-
-