Enum FxVanillaOptionMethod
- java.lang.Object
-
- java.lang.Enum<FxVanillaOptionMethod>
-
- com.opengamma.strata.measure.fxopt.FxVanillaOptionMethod
-
- All Implemented Interfaces:
CalculationParameter
,Named
,NamedEnum
,Serializable
,Comparable<FxVanillaOptionMethod>
public enum FxVanillaOptionMethod extends Enum<FxVanillaOptionMethod> implements NamedEnum, CalculationParameter
The method to use for pricing FX vanilla options.This provides the ability to use different methods for pricing FX options. The Black and Vanna-Volga methods are supported.
This enum implements
CalculationParameter
and is used by passing it as an argument toCalculationRules
. It provides the link between the data that the function needs and the data that is available inScenarioMarketData
.Implementations of this interface must be immutable.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLACK
The Black (lognormal) model.VANNA_VOLGA
The Vanna-Volga model.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<CalculationParameter>
filter(CalculationTarget target, Measure measure)
Filters this parameter to the specified target and measure.static FxVanillaOptionMethod
of(String name)
Obtains an instance from the specified name.String
toString()
Returns the formatted name of the type.static FxVanillaOptionMethod
valueOf(String name)
Returns the enum constant of this type with the specified name.static FxVanillaOptionMethod[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
queryType
-
-
-
-
Enum Constant Detail
-
BLACK
public static final FxVanillaOptionMethod BLACK
The Black (lognormal) model. This uses Black volatilities -BlackFxOptionVolatilities
.
-
VANNA_VOLGA
public static final FxVanillaOptionMethod VANNA_VOLGA
The Vanna-Volga model. This uses Black volatilities based on a smile -BlackFxOptionSmileVolatilities
.
-
-
Method Detail
-
values
public static FxVanillaOptionMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FxVanillaOptionMethod c : FxVanillaOptionMethod.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FxVanillaOptionMethod valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
public static FxVanillaOptionMethod of(String name)
Obtains an instance from the specified name.Parsing handles the mixed case form produced by
toString()
and the upper and lower case variants of the enum constant name.- Parameters:
name
- the name to parse- Returns:
- the type
- Throws:
IllegalArgumentException
- if the name is not known
-
filter
public Optional<CalculationParameter> filter(CalculationTarget target, Measure measure)
Description copied from interface:CalculationParameter
Filters this parameter to the specified target and measure.Parameters may apply to all targets and measures or just a subset. The
CalculationParameters.filter(CalculationTarget, Measure)
method uses this method to filter a complete set of parameters.By default, this returns
Optional.of(this)
. If the parameter does not apply to either the target or measure, then optional empty must be returned. If desired, the result can be a different parameter, allowing one parameter to delegate to another when filtered.- Specified by:
filter
in interfaceCalculationParameter
- Parameters:
target
- the calculation target, such as a trademeasure
- the measure to be calculated- Returns:
- the parameter appropriate to the target and measure, empty if this parameter does not apply
-
toString
public String toString()
Returns the formatted name of the type.- Overrides:
toString
in classEnum<FxVanillaOptionMethod>
- Returns:
- the formatted string representing the type
-
-