Class DefaultCurveMetadata
- java.lang.Object
-
- com.opengamma.strata.market.curve.DefaultCurveMetadata
-
- All Implemented Interfaces:
CurveMetadata
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class DefaultCurveMetadata extends Object implements CurveMetadata, org.joda.beans.ImmutableBean, Serializable
Default metadata for a curve.This implementation of
CurveMetadata
provides the curve name and nodes.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultCurveMetadata.Meta
The meta-bean forDefaultCurveMetadata
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultCurveMetadataBuilder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
<T> Optional<T>
findInfo(CurveInfoType<T> type)
Finds curve information of a specific type.CurveName
getCurveName()
Gets the curve name.ImmutableMap<CurveInfoType<?>,Object>
getInfo()
Gets the additional curve information.<T> T
getInfo(CurveInfoType<T> type)
Gets curve information of a specific type.Optional<List<ParameterMetadata>>
getParameterMetadata()
Gets the metadata about the parameters.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.int
hashCode()
static DefaultCurveMetadata.Meta
meta()
The meta-bean forDefaultCurveMetadata
.DefaultCurveMetadata.Meta
metaBean()
static DefaultCurveMetadata
of(CurveName name)
Creates the metadata.static DefaultCurveMetadata
of(String name)
Creates the metadata.DefaultCurveMetadataBuilder
toBuilder()
Returns a mutable builder initialized with the state of this bean.String
toString()
<T> DefaultCurveMetadata
withInfo(CurveInfoType<T> type, T value)
Returns an instance where the specified additional information has been added.DefaultCurveMetadata
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.curve.CurveMetadata
findParameterIndex, getParameterMetadata
-
-
-
-
Method Detail
-
of
public static DefaultCurveMetadata of(String name)
Creates the metadata.No information will be available for the x-values, y-values or parameters.
- Parameters:
name
- the curve name- Returns:
- the metadata
-
of
public static DefaultCurveMetadata of(CurveName name)
Creates the metadata.No information will be available for the x-values, y-values or parameters.
- Parameters:
name
- the curve name- Returns:
- the metadata
-
builder
public static DefaultCurveMetadataBuilder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
getInfo
public <T> T getInfo(CurveInfoType<T> type)
Description copied from interface:CurveMetadata
Gets curve information of a specific type.If the information is not found, an exception is thrown.
The most common information is the day count and curve calibration information.
- Specified by:
getInfo
in interfaceCurveMetadata
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the curve information
-
findInfo
public <T> Optional<T> findInfo(CurveInfoType<T> type)
Description copied from interface:CurveMetadata
Finds curve information of a specific type.If the info is not found, optional empty is returned.
The most common information is the day count and curve calibration information.
- Specified by:
findInfo
in interfaceCurveMetadata
- Type Parameters:
T
- the type of the info- Parameters:
type
- the type to find- Returns:
- the curve information
-
withInfo
public <T> DefaultCurveMetadata withInfo(CurveInfoType<T> type, T value)
Description copied from interface:CurveMetadata
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 interfaceCurveMetadata
- 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 curve metadata
-
withParameterMetadata
public DefaultCurveMetadata withParameterMetadata(List<? extends ParameterMetadata> parameterMetadata)
Description copied from interface:CurveMetadata
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 interfaceCurveMetadata
- Parameters:
parameterMetadata
- the new parameter metadata, may be null- Returns:
- the new curve metadata
-
toBuilder
public DefaultCurveMetadataBuilder toBuilder()
Returns a mutable builder initialized with the state of this bean.- Returns:
- the mutable builder, not null
-
meta
public static DefaultCurveMetadata.Meta meta()
The meta-bean forDefaultCurveMetadata
.- Returns:
- the meta-bean, not null
-
metaBean
public DefaultCurveMetadata.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getCurveName
public CurveName getCurveName()
Gets the curve name.- Specified by:
getCurveName
in interfaceCurveMetadata
- 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 interfaceCurveMetadata
- 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. For example, the y-value might represent a zero rate, as represented using
ValueType.ZERO_RATE
.If using the builder, this defaults to
ValueType.UNKNOWN
.- Specified by:
getYValueType
in interfaceCurveMetadata
- Returns:
- the value of the property, not null
-
getInfo
public ImmutableMap<CurveInfoType<?>,Object> getInfo()
Gets the additional curve information.This stores additional information for the curve.
The most common information is the day count and curve calibration Jacobian.
- 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 will match the number of parameters on the curve.
- Specified by:
getParameterMetadata
in interfaceCurveMetadata
- Returns:
- the optional value of the property, not null
-
-