Class RatesCurveGroup
- java.lang.Object
-
- com.opengamma.strata.market.curve.RatesCurveGroup
-
- All Implemented Interfaces:
CurveGroup,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class RatesCurveGroup extends Object implements CurveGroup, org.joda.beans.ImmutableBean, Serializable
A group of curves.This is used to hold a group of related curves, typically forming a logical set. It is often used to hold the results of a curve calibration.
Curve groups can also be created from a set of existing curves.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRatesCurveGroup.BuilderThe bean-builder forRatesCurveGroup.static classRatesCurveGroup.MetaThe meta-bean forRatesCurveGroup.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RatesCurveGroup.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)Optional<Curve>findCurve(CurveName name)Finds the curve with the specified name.Optional<Curve>findDiscountCurve(Currency currency)Finds the discount curve for the currency if there is one in the group.Optional<Curve>findForwardCurve(Index index)Finds the forward curve for the index if there is one in the group.ImmutableMap<Currency,Curve>getDiscountCurves()Gets the discount curves in the group, keyed by currency.ImmutableMap<Index,Curve>getForwardCurves()Gets the forward curves in the group, keyed by index.CurveGroupNamegetName()Gets the name of the curve group.inthashCode()static RatesCurveGroup.Metameta()The meta-bean forRatesCurveGroup.RatesCurveGroup.MetametaBean()static RatesCurveGroupof(CurveGroupName name, Map<Currency,Curve> discountCurves, Map<Index,Curve> forwardCurves)Returns a curve group containing the specified curves.static RatesCurveGroupofCurves(RatesCurveGroupDefinition curveGroupDefinition, Curve... curves)Creates a curve group using a curve group definition and some existing curves.static RatesCurveGroupofCurves(RatesCurveGroupDefinition curveGroupDefinition, Collection<? extends Curve> curves)Creates a curve group using a curve group definition and a list of existing curves.Stream<Curve>stream()Returns a stream of all curves in the group.RatesCurveGroup.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()
-
-
-
Method Detail
-
of
public static RatesCurveGroup of(CurveGroupName name, Map<Currency,Curve> discountCurves, Map<Index,Curve> forwardCurves)
Returns a curve group containing the specified curves.- Parameters:
name- the name of the curve groupdiscountCurves- the discount curves, keyed by currencyforwardCurves- the forward curves, keyed by index- Returns:
- a curve group containing the specified curves
-
ofCurves
public static RatesCurveGroup ofCurves(RatesCurveGroupDefinition curveGroupDefinition, Curve... curves)
Creates a curve group using a curve group definition and some existing curves.If there are curves named in the definition which are not present in the curves the group is built using whatever curves are available.
If there are multiple curves with the same name in the curves one of them is arbitrarily chosen.
Multiple curves with the same name are allowed to support the use case where the list contains the same curve multiple times. This means the caller doesn't have to filter the input curves to remove duplicates.
- Parameters:
curveGroupDefinition- the definition of a curve groupcurves- some curves- Returns:
- a curve group built from the definition and the list of curves
-
ofCurves
public static RatesCurveGroup ofCurves(RatesCurveGroupDefinition curveGroupDefinition, Collection<? extends Curve> curves)
Creates a curve group using a curve group definition and a list of existing curves.If there are curves named in the definition which are not present in the curves the group is built using whatever curves are available.
If there are multiple curves with the same name in the curves one of them is arbitrarily chosen.
Multiple curves with the same name are allowed to support the use case where the list contains the same curve multiple times. This means the caller doesn't have to filter the input curves to remove duplicates.
- Parameters:
curveGroupDefinition- the definition of a curve groupcurves- some curves- Returns:
- a curve group built from the definition and the list of curves
-
findCurve
public Optional<Curve> findCurve(CurveName name)
Finds the curve with the specified name.If the curve cannot be found, empty is returned.
- Specified by:
findCurvein interfaceCurveGroup- Parameters:
name- the curve name- Returns:
- the curve, empty if not found
-
findDiscountCurve
public Optional<Curve> findDiscountCurve(Currency currency)
Finds the discount curve for the currency if there is one in the group.If the curve is not found, optional empty is returned.
- Parameters:
currency- the currency for which a discount curve is required- Returns:
- the discount curve for the currency if there is one in the group
-
findForwardCurve
public Optional<Curve> findForwardCurve(Index index)
Finds the forward curve for the index if there is one in the group.If the curve is not found, optional empty is returned.
- Parameters:
index- the index for which a forward curve is required- Returns:
- the forward curve for the index if there is one in the group
-
stream
public Stream<Curve> stream()
Returns a stream of all curves in the group.- Specified by:
streamin interfaceCurveGroup- Returns:
- Returns a stream of all curves in the group
-
meta
public static RatesCurveGroup.Meta meta()
The meta-bean forRatesCurveGroup.- Returns:
- the meta-bean, not null
-
builder
public static RatesCurveGroup.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public RatesCurveGroup.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public CurveGroupName getName()
Gets the name of the curve group.- Specified by:
getNamein interfaceCurveGroup- Returns:
- the value of the property, not null
-
getDiscountCurves
public ImmutableMap<Currency,Curve> getDiscountCurves()
Gets the discount curves in the group, keyed by currency.- Returns:
- the value of the property, not null
-
getForwardCurves
public ImmutableMap<Index,Curve> getForwardCurves()
Gets the forward curves in the group, keyed by index.- Returns:
- the value of the property, not null
-
toBuilder
public RatesCurveGroup.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-