Class RepoCurveZeroRateSensitivity
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.RepoCurveZeroRateSensitivity
-
- All Implemented Interfaces:
FxConvertible<PointSensitivity>,PointSensitivity,PointSensitivityBuilder,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class RepoCurveZeroRateSensitivity extends Object implements PointSensitivity, PointSensitivityBuilder, org.joda.beans.ImmutableBean, Serializable
Point sensitivity to the repo curve.Holds the sensitivity to the repo curve at a specific date.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRepoCurveZeroRateSensitivity.MetaThe meta-bean forRepoCurveZeroRateSensitivity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MutablePointSensitivitiesbuildInto(MutablePointSensitivities combination)Builds the point sensitivity, adding to the specified mutable instance.RepoCurveZeroRateSensitivitycloned()Clones the point sensitivity builder.intcompareKey(PointSensitivity other)Compares the key of two sensitivities, excluding the point sensitivity value.RepoCurveZeroRateSensitivityconvertedTo(Currency resultCurrency, FxRateProvider rateProvider)Converts this instance to an equivalent amount in the specified currency.ZeroRateSensitivitycreateZeroRateSensitivity()Obtains the underlyingZeroRateSensitivity.booleanequals(Object obj)CurrencygetCurrency()Gets the currency of the sensitivity.CurrencygetCurveCurrency()Gets the currency of the curve for which the sensitivity is computed.RepoGroupgetRepoGroup()Gets the repo group.doublegetSensitivity()Gets the value of the sensitivity.doublegetYearFraction()Gets the time that was queried, expressed as a year fraction.inthashCode()RepoCurveZeroRateSensitivitymapSensitivity(DoubleUnaryOperator operator)Returns an instance with the specified operation applied to the sensitivities in this builder.static RepoCurveZeroRateSensitivity.Metameta()The meta-bean forRepoCurveZeroRateSensitivity.RepoCurveZeroRateSensitivity.MetametaBean()RepoCurveZeroRateSensitivitymultipliedBy(double factor)Multiplies the sensitivities in this builder by the specified factor.RepoCurveZeroRateSensitivitynormalize()Normalizes the point sensitivities by sorting and merging.static RepoCurveZeroRateSensitivityof(Currency curveCurrency, double yearFraction, Currency sensitivityCurrency, RepoGroup repoGroup, double sensitivity)Obtains an instance from the curve currency, date, sensitivity currency, group and value.static RepoCurveZeroRateSensitivityof(Currency currency, double yearFraction, RepoGroup repoGroup, double sensitivity)Obtains an instance from the curve currency, date, group and value.static RepoCurveZeroRateSensitivityof(ZeroRateSensitivity zeroRateSensitivity, RepoGroup repoGroup)Obtains an instance from zero rate sensitivity and group.StringtoString()RepoCurveZeroRateSensitivitywithCurrency(Currency currency)Returns an instance with the specified sensitivity currency set.RepoCurveZeroRateSensitivitywithSensitivity(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 com.opengamma.strata.market.sensitivity.PointSensitivityBuilder
build, combinedWith
-
-
-
-
Method Detail
-
of
public static RepoCurveZeroRateSensitivity of(Currency currency, double yearFraction, RepoGroup repoGroup, double sensitivity)
Obtains an instance from the curve currency, date, group and value.The currency representing the curve is used also for the sensitivity currency.
- Parameters:
currency- the currency of the curve and sensitivityyearFraction- the year fraction that was looked up on the curverepoGroup- the groupsensitivity- the value of the sensitivity- Returns:
- the point sensitivity object
-
of
public static RepoCurveZeroRateSensitivity of(ZeroRateSensitivity zeroRateSensitivity, RepoGroup repoGroup)
Obtains an instance from zero rate sensitivity and group.- Parameters:
zeroRateSensitivity- the zero rate sensitivityrepoGroup- the group- Returns:
- the point sensitivity object
-
of
public static RepoCurveZeroRateSensitivity of(Currency curveCurrency, double yearFraction, Currency sensitivityCurrency, RepoGroup repoGroup, double sensitivity)
Obtains an instance from the curve currency, date, sensitivity currency, group and value.- Parameters:
curveCurrency- the currency of the curveyearFraction- the year fraction that was looked up on the curvesensitivityCurrency- the currency of the sensitivityrepoGroup- the groupsensitivity- the value of the sensitivity- Returns:
- the point sensitivity object
-
withCurrency
public RepoCurveZeroRateSensitivity withCurrency(Currency currency)
Description copied from interface:PointSensitivityReturns an instance with the specified sensitivity currency set.The result will consists of the same points, but with the sensitivity currency altered.
- Specified by:
withCurrencyin interfacePointSensitivity- Specified by:
withCurrencyin interfacePointSensitivityBuilder- Parameters:
currency- the new currency- Returns:
- an instance based on this sensitivity with the specified currency
-
withSensitivity
public RepoCurveZeroRateSensitivity withSensitivity(double sensitivity)
Description copied from interface:PointSensitivityReturns an instance with the new point sensitivity value.- Specified by:
withSensitivityin interfacePointSensitivity- 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:PointSensitivityCompares 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:
compareKeyin interfacePointSensitivity- Parameters:
other- the other sensitivity- Returns:
- positive if greater, zero if equal, negative if less
-
convertedTo
public RepoCurveZeroRateSensitivity convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
Description copied from interface:PointSensitivityConverts 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:
convertedToin interfaceFxConvertible<PointSensitivity>- Specified by:
convertedToin interfacePointSensitivity- Parameters:
resultCurrency- the currency of the resultrateProvider- the provider of FX rates- Returns:
- the converted instance, which should be expressed in the specified currency
-
multipliedBy
public RepoCurveZeroRateSensitivity multipliedBy(double factor)
Description copied from interface:PointSensitivityBuilderMultiplies 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:
multipliedByin interfacePointSensitivityBuilder- Parameters:
factor- the multiplicative factor- Returns:
- the resulting builder, replacing this builder
-
mapSensitivity
public RepoCurveZeroRateSensitivity mapSensitivity(DoubleUnaryOperator operator)
Description copied from interface:PointSensitivityBuilderReturns 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:
mapSensitivityin interfacePointSensitivityBuilder- Parameters:
operator- the operator to be applied to the sensitivities- Returns:
- the resulting builder, replacing this builder
-
normalize
public RepoCurveZeroRateSensitivity normalize()
Description copied from interface:PointSensitivityBuilderNormalizes 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:
normalizein interfacePointSensitivityBuilder- Returns:
- the resulting builder, replacing this builder
-
buildInto
public MutablePointSensitivities buildInto(MutablePointSensitivities combination)
Description copied from interface:PointSensitivityBuilderBuilds the point sensitivity, adding to the specified mutable instance.- Specified by:
buildIntoin interfacePointSensitivityBuilder- Parameters:
combination- the combination object to add to- Returns:
- the specified mutable point sensitivities instance is returned, for method chaining
-
cloned
public RepoCurveZeroRateSensitivity cloned()
Description copied from interface:PointSensitivityBuilderClones the point sensitivity builder.This returns a
PointSensitivityBuilderinstance 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:
clonedin interfacePointSensitivityBuilder- Returns:
- the built combined sensitivity
-
createZeroRateSensitivity
public ZeroRateSensitivity createZeroRateSensitivity()
Obtains the underlyingZeroRateSensitivity.This creates the zero rate sensitivity object by omitting the repo group.
- Returns:
- the point sensitivity object
-
meta
public static RepoCurveZeroRateSensitivity.Meta meta()
The meta-bean forRepoCurveZeroRateSensitivity.- Returns:
- the meta-bean, not null
-
metaBean
public RepoCurveZeroRateSensitivity.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getCurveCurrency
public Currency getCurveCurrency()
Gets the currency of the curve for which the sensitivity is computed.- Returns:
- the value of the property, not null
-
getYearFraction
public double getYearFraction()
Gets the time that was queried, expressed as a year fraction.- Returns:
- the value of the property
-
getCurrency
public Currency getCurrency()
Gets the currency of the sensitivity.- Specified by:
getCurrencyin interfacePointSensitivity- Returns:
- the value of the property, not null
-
getRepoGroup
public RepoGroup getRepoGroup()
Gets the repo group.This defines the group that the discount factors are for.
- Returns:
- the value of the property, not null
-
getSensitivity
public double getSensitivity()
Gets the value of the sensitivity.- Specified by:
getSensitivityin interfacePointSensitivity- Returns:
- the value of the property
-
-