## Class CreditCurveZeroRateSensitivity

• java.lang.Object
• com.opengamma.strata.pricer.credit.CreditCurveZeroRateSensitivity
• All Implemented Interfaces:
FxConvertible<PointSensitivity>, PointSensitivity, PointSensitivityBuilder, java.io.Serializable, Bean, ImmutableBean

public final class CreditCurveZeroRateSensitivity
extends java.lang.Object
implements PointSensitivity, PointSensitivityBuilder, ImmutableBean, java.io.Serializable
Point sensitivity to the zero hazard rate curve.

Holds the sensitivity to the zero hazard rate curve at a specific date.

Serialized Form
• ### Nested Class Summary

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

All Methods
Modifier and Type Method Description
MutablePointSensitivities buildInto​(MutablePointSensitivities combination)
Builds the point sensitivity, adding to the specified mutable instance.
CreditCurveZeroRateSensitivity cloned()
Clones the point sensitivity builder.
int compareKey​(PointSensitivity other)
Compares the key of two sensitivities, excluding the point sensitivity value.
CreditCurveZeroRateSensitivity convertedTo​(Currency resultCurrency, FxRateProvider rateProvider)
Converts this instance to an equivalent amount in the specified currency.
boolean equals​(java.lang.Object obj)
Currency getCurrency()
Gets the currency of the point sensitivity.
Currency getCurveCurrency()
Gets the currency of the curve for which the sensitivity is computed.
StandardId getLegalEntityId()
Gets the legal entity identifier.
double getSensitivity()
Gets the point sensitivity value.
double getYearFraction()
Gets the time that was queried, expressed as a year fraction.
ZeroRateSensitivity getZeroRateSensitivity()
Gets the zero rate sensitivity.
int hashCode()
CreditCurveZeroRateSensitivity mapSensitivity​(java.util.function.DoubleUnaryOperator operator)
Returns an instance with the specified operation applied to the sensitivities in this builder.
static CreditCurveZeroRateSensitivity.Meta meta()
The meta-bean for CreditCurveZeroRateSensitivity.
CreditCurveZeroRateSensitivity.Meta metaBean()
CreditCurveZeroRateSensitivity multipliedBy​(double factor)
Multiplies the sensitivities in this builder by the specified factor.
CreditCurveZeroRateSensitivity normalize()
Normalizes the point sensitivities by sorting and merging.
static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId, Currency currency, double yearFraction, double sensitivity)
Obtains an instance.
static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId, Currency curveCurrency, double yearFraction, Currency sensitivityCurrency, double sensitivity)
Obtains an instance with sensitivity currency specified.
static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId, ZeroRateSensitivity zeroRateSensitivity)
Obtains an instance from ZeroRateSensitivity and StandardId.
java.lang.String toString()
ZeroRateSensitivity toZeroRateSensitivity()
Obtains the underlying ZeroRateSensitivity.
CreditCurveZeroRateSensitivity withCurrency​(Currency currency)
Returns an instance with the specified sensitivity currency set.
CreditCurveZeroRateSensitivity withSensitivity​(double sensitivity)
Returns an instance with the new point sensitivity value.
• ### 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
• ### Methods inherited from interface com.opengamma.strata.market.sensitivity.PointSensitivityBuilder

build, combinedWith
• ### Method Detail

• #### of

public static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId,
Currency currency,
double yearFraction,
double sensitivity)
Obtains an instance.
Parameters:
legalEntityId - the legal entity identifier
currency - the currency of the curve and sensitivity
yearFraction - the year fraction that was looked up on the curve
sensitivity - the value of the sensitivity
Returns:
the point sensitivity object
• #### of

public static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId,
Currency curveCurrency,
double yearFraction,
Currency sensitivityCurrency,
double sensitivity)
Obtains an instance with sensitivity currency specified.
Parameters:
legalEntityId - the legal entity identifier
curveCurrency - the currency of the curve
yearFraction - the year fraction that was looked up on the curve
sensitivityCurrency - the currency of the sensitivity
sensitivity - the value of the sensitivity
Returns:
the point sensitivity object
• #### of

public static CreditCurveZeroRateSensitivity of​(StandardId legalEntityId,
ZeroRateSensitivity zeroRateSensitivity)
Obtains an instance from ZeroRateSensitivity and StandardId.
Parameters:
legalEntityId - the legal entity identifier
zeroRateSensitivity - the zero rate sensitivity
Returns:
the point sensitivity object
• #### getCurrency

public Currency getCurrency()
Description copied from interface: PointSensitivity
Gets the currency of the point sensitivity.
Specified by:
getCurrency in interface PointSensitivity
Returns:
the currency
• #### getSensitivity

public double getSensitivity()
Description copied from interface: PointSensitivity
Gets the point sensitivity value.
Specified by:
getSensitivity in interface PointSensitivity
Returns:
the sensitivity
• #### getCurveCurrency

public Currency getCurveCurrency()
Gets the currency of the curve for which the sensitivity is computed.
Returns:
the curve currency
• #### getYearFraction

public double getYearFraction()
Gets the time that was queried, expressed as a year fraction.
Returns:
the year fraction
• #### withCurrency

public CreditCurveZeroRateSensitivity withCurrency​(Currency currency)
Description copied from interface: PointSensitivity
Returns an instance with the specified sensitivity currency set.

The result will consists of the same points, but with the sensitivity currency altered.

Specified by:
withCurrency in interface PointSensitivity
Specified by:
withCurrency in interface PointSensitivityBuilder
Parameters:
currency - the new currency
Returns:
an instance based on this sensitivity with the specified currency
• #### withSensitivity

public CreditCurveZeroRateSensitivity withSensitivity​(double sensitivity)
Description copied from interface: PointSensitivity
Returns an instance with the new point sensitivity value.
Specified by:
withSensitivity in interface PointSensitivity
Parameters:
sensitivity - the new sensitivity
Returns:
an instance based on this sensitivity with the specified sensitivity
• #### compareKey

public int compareKey​(PointSensitivity other)
Description copied from interface: PointSensitivity
Compares the key of two sensitivities, excluding the point sensitivity value.

If the other point sensitivity is of a different type, the comparison is based solely on the simple class name. If the point sensitivity is of the same type, the comparison must check the key, then the currency, then the date, then any other state.

The comparison by simple class name ensures that all instances of the same type are ordered together.

Specified by:
compareKey in interface PointSensitivity
Parameters:
other - the other sensitivity
Returns:
positive if greater, zero if equal, negative if less
• #### convertedTo

public CreditCurveZeroRateSensitivity convertedTo​(Currency resultCurrency,
FxRateProvider rateProvider)
Description copied from interface: PointSensitivity
Converts this instance to an equivalent amount in the specified currency.

The result will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.

Specified by:
convertedTo in interface FxConvertible<PointSensitivity>
Specified by:
convertedTo in interface PointSensitivity
Parameters:
resultCurrency - the currency of the result
rateProvider - the provider of FX rates
Returns:
the converted instance, which should be expressed in the specified currency
• #### multipliedBy

public CreditCurveZeroRateSensitivity multipliedBy​(double factor)
Description copied from interface: PointSensitivityBuilder
Multiplies the sensitivities in this builder by the specified factor.

The result will consist of the same points, but with each sensitivity multiplied.

Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.

Specified by:
multipliedBy in interface PointSensitivityBuilder
Parameters:
factor - the multiplicative factor
Returns:
the resulting builder, replacing this builder
• #### mapSensitivity

public CreditCurveZeroRateSensitivity mapSensitivity​(java.util.function.DoubleUnaryOperator operator)
Description copied from interface: PointSensitivityBuilder
Returns an instance with the specified operation applied to the sensitivities in this builder.

The result will consist of the same points, but with the operator applied to each sensitivity.

This is used to apply a mathematical operation to the sensitivities. For example, the operator could multiply the sensitivities by a constant, or take the inverse.

   inverse = base.mapSensitivities(value -> 1 / value);


Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.

Specified by:
mapSensitivity in interface PointSensitivityBuilder
Parameters:
operator - the operator to be applied to the sensitivities
Returns:
the resulting builder, replacing this builder
• #### normalize

public CreditCurveZeroRateSensitivity normalize()
Description copied from interface: PointSensitivityBuilder
Normalizes the point sensitivities by sorting and merging.

The sensitivities in the builder are sorted and then merged. Any two entries that represent the same curve query are merged. For example, if there are two point sensitivities that were created based on the same curve, currency and fixing date, then the entries are combined, summing the sensitivity value.

Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.

Specified by:
normalize in interface PointSensitivityBuilder
Returns:
the resulting builder, replacing this builder
• #### buildInto

public MutablePointSensitivities buildInto​(MutablePointSensitivities combination)
Description copied from interface: PointSensitivityBuilder
Builds the point sensitivity, adding to the specified mutable instance.
Specified by:
buildInto in interface PointSensitivityBuilder
Parameters:
combination - the combination object to add to
Returns:
the specified mutable point sensitivities instance is returned, for method chaining
• #### cloned

public CreditCurveZeroRateSensitivity cloned()
Description copied from interface: PointSensitivityBuilder
Clones the point sensitivity builder.

This returns a PointSensitivityBuilder instance that is independent from the original. Immutable implementations may return themselves.

Builders may be mutable. Using this method allows a copy of the original to be obtained, so both the original and the clone can be used.

Specified by:
cloned in interface PointSensitivityBuilder
Returns:
the built combined sensitivity
• #### toZeroRateSensitivity

public ZeroRateSensitivity toZeroRateSensitivity()
Obtains the underlying ZeroRateSensitivity.

This creates the zero rate sensitivity object by omitting the legal entity identifier.

Returns:
the point sensitivity object
• #### meta

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

public CreditCurveZeroRateSensitivity.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getLegalEntityId

public StandardId getLegalEntityId()
Gets the legal entity identifier.

This identifier is used for the reference legal entity of a credit derivative.

Returns:
the value of the property, not null
• #### getZeroRateSensitivity

public ZeroRateSensitivity getZeroRateSensitivity()
Gets the zero rate sensitivity.

This stores curve currency, year fraction, sensitivity currency and sensitivity value.

Returns:
the value of the property, not null
• #### equals

public boolean equals​(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
• #### hashCode

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

public java.lang.String toString()
Overrides:
toString in class java.lang.Object