public interface CurveMetadata
Implementations of this interface are used to store metadata about a curve.
For example, a curve may be defined based on financial instruments.
The parameters might represent 1 day, 1 week, 1 month, 3 month and 6 months.
The metadata could be used to describe each parameter in terms of a Tenor.
This metadata can be used by applications to interpret the parameters of the curve. For example, the scenario framework uses the data when applying perturbations.
See Curves for helper methods that create common curve types.
| Modifier and Type | Method and Description |
|---|---|
<T> Optional<T> |
findInfo(CurveInfoType<T> type)
Finds curve information of a specific type.
|
default OptionalInt |
findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.
|
CurveName |
getCurveName()
Gets the curve name.
|
default <T> T |
getInfo(CurveInfoType<T> type)
Gets curve information of a specific type.
|
Optional<List<ParameterMetadata>> |
getParameterMetadata()
Gets metadata about each parameter underlying the curve, optional.
|
default ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
ValueType |
getXValueType()
Gets the x-value type, providing meaning to the x-values of the curve.
|
ValueType |
getYValueType()
Gets the y-value type, providing meaning to the y-values of the curve.
|
<T> DefaultCurveMetadata |
withInfo(CurveInfoType<T> type,
T value)
Returns an instance where the specified additional information has been added.
|
CurveMetadata |
withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Returns an instance where the parameter metadata has been changed.
|
CurveName getCurveName()
ValueType getXValueType()
This type provides meaning to the x-values. For example, the x-value might
represent a year fraction, as represented using ValueType.YEAR_FRACTION.
Note that if the x-value of the curve represents time as a year fraction, the day count should be specified in the info map to define how the year fraction is calculated.
ValueType getYValueType()
This type provides meaning to the y-values. For example, the y-value might
represent a zero rate, as represented using ValueType.ZERO_RATE.
default <T> T getInfo(CurveInfoType<T> type)
If the information is not found, an exception is thrown.
The most common information is the day count and curve calibration information.
T - the type of the infotype - the type to findIllegalArgumentException - if the information is not found<T> Optional<T> findInfo(CurveInfoType<T> type)
If the info is not found, optional empty is returned.
The most common information is the day count and curve calibration information.
T - the type of the infotype - the type to finddefault ParameterMetadata getParameterMetadata(int parameterIndex)
If there is no specific parameter metadata, an empty instance will be returned.
parameterIndex - the zero-based index of the parameter to getIndexOutOfBoundsException - if the index is invalidOptional<List<ParameterMetadata>> getParameterMetadata()
If present, the parameter metadata will match the number of parameters on the curve.
default OptionalInt findParameterIndex(ParameterMetadata metadata)
If the parameter metadata is not matched, an empty optional will be returned.
metadata - the parameter metadata to find the index of<T> DefaultCurveMetadata withInfo(CurveInfoType<T> type, T value)
The additional information is stored in the result using Map.put semantics,
removing the key if the instance is null.
T - the type of the infotype - the type to store undervalue - the value to store, may be nullCurveMetadata withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
The result will contain the specified parameter metadata. A null value is accepted and causes the result to have no parameter metadata.
parameterMetadata - the new parameter metadata, may be nullCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.