Interface SurfaceMetadata
-
- All Known Implementing Classes:
DefaultSurfaceMetadata
public interface SurfaceMetadata
Metadata about a surface and surface parameters.Implementations of this interface are used to store metadata about a surface. For example, a surface 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 surface. For example, the scenario framework uses the data when applying perturbations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> Optional<T>
findInfo(SurfaceInfoType<T> type)
Finds surface information of a specific type.default OptionalInt
findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.default <T> T
getInfo(SurfaceInfoType<T> type)
Gets surface information of a specific type.Optional<List<ParameterMetadata>>
getParameterMetadata()
Gets metadata about each parameter underlying the surface, optional.default ParameterMetadata
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.SurfaceName
getSurfaceName()
Gets the surface name.ValueType
getXValueType()
Gets the x-value type, providing meaning to the x-values of the surface.ValueType
getYValueType()
Gets the y-value type, providing meaning to the y-values of the surface.ValueType
getZValueType()
Gets the z-value type, providing meaning to the z-values of the surface.<T> DefaultSurfaceMetadata
withInfo(SurfaceInfoType<T> type, T value)
Returns an instance where the specified additional information has been added.SurfaceMetadata
withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Returns an instance where the parameter metadata has been changed.
-
-
-
Method Detail
-
getSurfaceName
SurfaceName getSurfaceName()
Gets the surface name.- Returns:
- the surface name
-
getXValueType
ValueType getXValueType()
Gets the x-value type, providing meaning to the x-values of the surface.This type provides meaning to the x-values. For example, the x-value might represent a year fraction, as represented using
ValueType.YEAR_FRACTION
.- Returns:
- the x-value type
-
getYValueType
ValueType getYValueType()
Gets the y-value type, providing meaning to the y-values of the surface.This type provides meaning to the y-values.
- Returns:
- the y-value type
-
getZValueType
ValueType getZValueType()
Gets the z-value type, providing meaning to the z-values of the surface.This type provides meaning to the z-values.
- Returns:
- the z-value type
-
getInfo
default <T> T getInfo(SurfaceInfoType<T> type)
Gets surface information of a specific type.If the information is not found, an exception is thrown.
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the surface information
- Throws:
IllegalArgumentException
- if the information is not found
-
findInfo
<T> Optional<T> findInfo(SurfaceInfoType<T> type)
Finds surface information of a specific type.If the info is not found, optional empty is returned.
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the surface information
-
getParameterMetadata
default ParameterMetadata getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.If there is no specific parameter metadata, an empty instance will be returned.
- Parameters:
parameterIndex
- the zero-based index of the parameter to get- Returns:
- the metadata of the parameter
- Throws:
IndexOutOfBoundsException
- if the index is invalid
-
getParameterMetadata
Optional<List<ParameterMetadata>> getParameterMetadata()
Gets metadata about each parameter underlying the surface, optional.If present, the parameter metadata will match the number of parameters on the surface.
- Returns:
- the parameter metadata
-
findParameterIndex
default OptionalInt findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.If the parameter metadata is not matched, an empty optional will be returned.
- Parameters:
metadata
- the parameter metadata to find the index of- Returns:
- the index of the parameter
-
withInfo
<T> DefaultSurfaceMetadata withInfo(SurfaceInfoType<T> type, T value)
Returns an instance where the specified additional information has been added.The additional information is stored in the result using
Map.put
semantics, removing the key if the instance is null.- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to store undervalue
- the value to store, may be null- Returns:
- the new surface metadata
-
withParameterMetadata
SurfaceMetadata withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Returns an instance where the parameter metadata has been changed.The result will contain the specified parameter metadata. A null value is accepted and causes the result to have no parameter metadata.
- Parameters:
parameterMetadata
- the new parameter metadata, may be null- Returns:
- the new surface metadata
-
-