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
SurfaceMetadataprovides the surface name and nodes.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultSurfaceMetadata.MetaThe meta-bean forDefaultSurfaceMetadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultSurfaceMetadataBuilderbuilder()Returns a builder used to create an instance of the bean.booleanequals(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> TgetInfo(SurfaceInfoType<T> type)Gets surface information of a specific type.Optional<List<ParameterMetadata>>getParameterMetadata()Gets the metadata about the parameters.SurfaceNamegetSurfaceName()Gets the surface name.ValueTypegetXValueType()Gets the x-value type, providing meaning to the x-values of the curve.ValueTypegetYValueType()Gets the y-value type, providing meaning to the y-values of the curve.ValueTypegetZValueType()Gets the x-value type, providing meaning to the z-values of the curve.inthashCode()static DefaultSurfaceMetadata.Metameta()The meta-bean forDefaultSurfaceMetadata.DefaultSurfaceMetadata.MetametaBean()static DefaultSurfaceMetadataof(SurfaceName name)Creates the metadata.static DefaultSurfaceMetadataof(String name)Creates the metadata.DefaultSurfaceMetadataBuildertoBuilder()Returns a mutable builder initialized with the state of this bean.StringtoString()<T> DefaultSurfaceMetadatawithInfo(SurfaceInfoType<T> type, T value)Returns an instance where the specified additional information has been added.DefaultSurfaceMetadatawithParameterMetadata(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:SurfaceMetadataGets surface information of a specific type.If the information is not found, an exception is thrown.
- Specified by:
getInfoin 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:SurfaceMetadataFinds surface information of a specific type.If the info is not found, optional empty is returned.
- Specified by:
findInfoin 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:SurfaceMetadataReturns an instance where the specified additional information has been added.The additional information is stored in the result using
Map.putsemantics, removing the key if the instance is null.- Specified by:
withInfoin 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:SurfaceMetadataReturns 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:
withParameterMetadatain 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:
metaBeanin interfaceorg.joda.beans.Bean
-
getSurfaceName
public SurfaceName getSurfaceName()
Gets the surface name.- Specified by:
getSurfaceNamein 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:
getXValueTypein 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:
getYValueTypein 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:
getZValueTypein 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:
getParameterMetadatain interfaceSurfaceMetadata- Returns:
- the optional value of the property, not null
-
-