Class DefaultSurfaceMetadata
- java.lang.Object
-
- com.opengamma.strata.market.surface.DefaultSurfaceMetadata
-
- All Implemented Interfaces:
SurfaceMetadata
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class DefaultSurfaceMetadata extends Object implements SurfaceMetadata, org.joda.beans.ImmutableBean, Serializable
Default metadata for a surface.This implementation of
SurfaceMetadata
provides the surface name and nodes.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultSurfaceMetadata.Meta
The meta-bean forDefaultSurfaceMetadata
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultSurfaceMetadataBuilder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
<T> Optional<T>
findInfo(SurfaceInfoType<T> type)
Finds surface information of a specific type.ImmutableMap<SurfaceInfoType<?>,Object>
getInfo()
Gets the additional surface information.<T> T
getInfo(SurfaceInfoType<T> type)
Gets surface information of a specific type.Optional<List<ParameterMetadata>>
getParameterMetadata()
Gets the metadata about the parameters.SurfaceName
getSurfaceName()
Gets the surface name.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.ValueType
getZValueType()
Gets the x-value type, providing meaning to the z-values of the curve.int
hashCode()
static DefaultSurfaceMetadata.Meta
meta()
The meta-bean forDefaultSurfaceMetadata
.DefaultSurfaceMetadata.Meta
metaBean()
static DefaultSurfaceMetadata
of(SurfaceName name)
Creates the metadata.static DefaultSurfaceMetadata
of(String name)
Creates the metadata.DefaultSurfaceMetadataBuilder
toBuilder()
Returns a mutable builder initialized with the state of this bean.String
toString()
<T> DefaultSurfaceMetadata
withInfo(SurfaceInfoType<T> type, T value)
Returns an instance where the specified additional information has been added.DefaultSurfaceMetadata
withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Returns an instance where the parameter metadata has been changed.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.market.surface.SurfaceMetadata
findParameterIndex, getParameterMetadata
-
-
-
-
Method Detail
-
of
public static DefaultSurfaceMetadata of(String name)
Creates the metadata.No information will be available for the x-values, y-values, z-values or parameters.
- Parameters:
name
- the surface name- Returns:
- the metadata
-
of
public static DefaultSurfaceMetadata of(SurfaceName name)
Creates the metadata.No information will be available for the x-values, y-values, z-values or parameters.
- Parameters:
name
- the surface name- Returns:
- the metadata
-
builder
public static DefaultSurfaceMetadataBuilder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
getInfo
public <T> T getInfo(SurfaceInfoType<T> type)
Description copied from interface:SurfaceMetadata
Gets surface information of a specific type.If the information is not found, an exception is thrown.
- Specified by:
getInfo
in interfaceSurfaceMetadata
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the surface information
-
findInfo
public <T> Optional<T> findInfo(SurfaceInfoType<T> type)
Description copied from interface:SurfaceMetadata
Finds surface information of a specific type.If the info is not found, optional empty is returned.
- Specified by:
findInfo
in interfaceSurfaceMetadata
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the surface information
-
withInfo
public <T> DefaultSurfaceMetadata withInfo(SurfaceInfoType<T> type, T value)
Description copied from interface:SurfaceMetadata
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.- Specified by:
withInfo
in interfaceSurfaceMetadata
- 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
public DefaultSurfaceMetadata withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Description copied from interface:SurfaceMetadata
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.
- Specified by:
withParameterMetadata
in interfaceSurfaceMetadata
- Parameters:
parameterMetadata
- the new parameter metadata, may be null- Returns:
- the new surface metadata
-
toBuilder
public DefaultSurfaceMetadataBuilder toBuilder()
Returns a mutable builder initialized with the state of this bean.- Returns:
- the mutable builder, not null
-
meta
public static DefaultSurfaceMetadata.Meta meta()
The meta-bean forDefaultSurfaceMetadata
.- Returns:
- the meta-bean, not null
-
metaBean
public DefaultSurfaceMetadata.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getSurfaceName
public SurfaceName getSurfaceName()
Gets the surface name.- Specified by:
getSurfaceName
in interfaceSurfaceMetadata
- Returns:
- the value of the property, not null
-
getXValueType
public ValueType getXValueType()
Gets the x-value type, providing meaning to the x-values of the curve.This type provides meaning to the x-values. For example, the x-value might represent a year fraction, as represented using
ValueType.YEAR_FRACTION
.If using the builder, this defaults to
ValueType.UNKNOWN
.- Specified by:
getXValueType
in interfaceSurfaceMetadata
- Returns:
- the value of the property, not null
-
getYValueType
public ValueType getYValueType()
Gets the y-value type, providing meaning to the y-values of the curve.This type provides meaning to the y-values.
If using the builder, this defaults to
ValueType.UNKNOWN
.- Specified by:
getYValueType
in interfaceSurfaceMetadata
- Returns:
- the value of the property, not null
-
getZValueType
public ValueType getZValueType()
Gets the x-value type, providing meaning to the z-values of the curve.This type provides meaning to the z-values.
If using the builder, this defaults to
ValueType.UNKNOWN
.- Specified by:
getZValueType
in interfaceSurfaceMetadata
- Returns:
- the value of the property, not null
-
getInfo
public ImmutableMap<SurfaceInfoType<?>,Object> getInfo()
Gets the additional surface information.This stores additional information for the surface.
- Returns:
- the value of the property, not null
-
getParameterMetadata
public Optional<List<ParameterMetadata>> getParameterMetadata()
Gets the metadata about the parameters.If present, the parameter metadata should match the number of parameters on the surface.
- Specified by:
getParameterMetadata
in interfaceSurfaceMetadata
- Returns:
- the optional value of the property, not null
-
-