com.opengamma.strata.market.curve

## Class CurveGroup

• All Implemented Interfaces:
Serializable, Bean, ImmutableBean

public final class CurveGroup
extends Object
implements 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.

Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  CurveGroup.Builder
The bean-builder for CurveGroup.
static class  CurveGroup.Meta
The meta-bean for CurveGroup.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static CurveGroup.Builder builder()
Returns a builder used to create an instance of the bean.
boolean equals(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.
CurveGroupName getName()
Gets the name of the curve group.
int hashCode()
static CurveGroup.Meta meta()
The meta-bean for CurveGroup.
CurveGroup.Meta metaBean()
static CurveGroup of(CurveGroupName name, Map<Currency,Curve> discountCurves, Map<Index,Curve> forwardCurves)
Returns a curve group containing the specified curves.
static CurveGroup ofCurves(CurveGroupDefinition curveGroupDefinition, Collection<? extends Curve> curves)
Creates a curve group using a curve group definition and a list of existing curves.
static CurveGroup ofCurves(CurveGroupDefinition curveGroupDefinition, Curve... curves)
Creates a curve group using a curve group definition and some existing curves.
Stream<Curve> stream()
Returns a stream of all curves in the group.
CurveGroup.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
String toString()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### Method Detail

• #### of

public static CurveGroup 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 group
discountCurves - the discount curves, keyed by currency
forwardCurves - the forward curves, keyed by index
Returns:
a curve group containing the specified curves
• #### ofCurves

public static CurveGroup ofCurves(CurveGroupDefinition 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 group
curves - some curves
Returns:
a curve group built from the definition and the list of curves
• #### ofCurves

public static CurveGroup ofCurves(CurveGroupDefinition 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 group
curves - 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.

Parameters:
name - the curve name
Returns:
• #### findDiscountCurve

public Optional<Curve> findDiscountCurve(Currency currency)
Finds the discount curve for the currency if there is one in the group.

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.

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.
Returns:
Returns a stream of all curves in the group
• #### meta

public static CurveGroup.Meta meta()
The meta-bean for CurveGroup.
Returns:
the meta-bean, not null
• #### builder

public static CurveGroup.Builder builder()
Returns a builder used to create an instance of the bean.
Returns:
the builder, not null
• #### metaBean

public CurveGroup.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getName

public CurveGroupName getName()
Gets the name of the curve group.
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 CurveGroup.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
Returns:
the mutable builder, not null
• #### equals

public boolean equals(Object obj)
Overrides:
equals in class Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object
• #### toString

public String toString()
Overrides:
toString in class Object