public interface CubeMetadata
Implementations of this interface are used to store metadata about a cube.
For example, a cube 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 cube. For example, the scenario framework uses the data when applying perturbations.
| Modifier and Type | Method and Description |
|---|---|
<T> Optional<T> |
findInfo(CubeInfoType<T> type)
Finds cube information of a specific type.
|
default OptionalInt |
findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.
|
CubeName |
getCubeName()
Gets the cube name.
|
default <T> T |
getInfo(CubeInfoType<T> type)
Gets cube information of a specific type.
|
Optional<List<ParameterMetadata>> |
getParameterMetadata()
Gets metadata about each parameter underlying the cube, optional.
|
default ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
ValueType |
getWValueType()
Gets the w-value type, providing meaning to the w-values of the cube.
|
ValueType |
getXValueType()
Gets the x-value type, providing meaning to the x-values of the cube.
|
ValueType |
getYValueType()
Gets the y-value type, providing meaning to the y-values of the cube.
|
ValueType |
getZValueType()
Gets the z-value type, providing meaning to the z-values of the cube.
|
<T> DefaultCubeMetadata |
withInfo(CubeInfoType<T> type,
T value)
Returns an instance where the specified additional information has been added.
|
CubeMetadata |
withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Returns an instance where the parameter metadata has been changed.
|
CubeName getCubeName()
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.
ValueType getYValueType()
This type provides meaning to the y-values.
ValueType getZValueType()
This type provides meaning to the z-values.
ValueType getWValueType()
This type provides meaning to the w-values.
default <T> T getInfo(CubeInfoType<T> type)
If the information is not found, an exception is thrown.
T - the type of the infotype - the type to findIllegalArgumentException - if the information is not found<T> Optional<T> findInfo(CubeInfoType<T> type)
If the info is not found, optional empty is returned.
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 cube.
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> DefaultCubeMetadata withInfo(CubeInfoType<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 nullCubeMetadata 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.