Class ImmutableLegalEntityDiscountingProvider
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.ImmutableLegalEntityDiscountingProvider
-
- All Implemented Interfaces:
LegalEntityDiscountingProvider,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ImmutableLegalEntityDiscountingProvider extends Object implements LegalEntityDiscountingProvider, org.joda.beans.ImmutableBean, Serializable
An immutable provider of data for bond pricing, based on repo and issuer discounting.This used to price bonds issued by a legal entity. The data to do this includes discount factors of repo curves and issuer curves. If the bond is inflation linked, the price index data is obtained from
RatesProvider.Two types of discount factors are provided by this class. Repo curves are looked up using either the security ID of the bond, or the issuer (legal entity). Issuer curves are only looked up using the issuer (legal entity).
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableLegalEntityDiscountingProvider.BuilderThe bean-builder forImmutableLegalEntityDiscountingProvider.static classImmutableLegalEntityDiscountingProvider.MetaThe meta-bean forImmutableLegalEntityDiscountingProvider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLegalEntityDiscountingProvider.Builderbuilder()Returns a builder used to create an instance of the bean.<T> Tdata(MarketDataId<T> id)Gets market data of a specific type.booleanequals(Object obj)<T> Optional<T>findData(MarketDataName<T> name)Finds the market data with the specified name.ImmutableMap<LegalEntityId,LegalEntityGroup>getIssuerCurveGroups()Gets the groups used to find an issuer curve by legal entity.ImmutableMap<Pair<LegalEntityGroup,Currency>,DiscountFactors>getIssuerCurves()Gets the issuer curves, keyed by group and currency.ImmutableMap<LegalEntityId,RepoGroup>getRepoCurveGroups()Gets the groups used to find a repo curve by legal entity.ImmutableMap<Pair<RepoGroup,Currency>,DiscountFactors>getRepoCurves()Gets the repo curves, keyed by group and currency.ImmutableMap<SecurityId,RepoGroup>getRepoCurveSecurityGroups()Gets the groups used to find a repo curve by security.LocalDategetValuationDate()Gets the valuation date.inthashCode()IssuerCurveDiscountFactorsissuerCurveDiscountFactors(LegalEntityId issuerId, Currency currency)Gets the discount factors from an issuer based on the issuer ID and currency.static ImmutableLegalEntityDiscountingProvider.Metameta()The meta-bean forImmutableLegalEntityDiscountingProvider.ImmutableLegalEntityDiscountingProvider.MetametaBean()CurrencyParameterSensitivitiesparameterSensitivity(PointSensitivities pointSensitivities)Computes the parameter sensitivity.RepoCurveDiscountFactorsrepoCurveDiscountFactors(LegalEntityId issuerId, Currency currency)Gets the discount factors from a repo curve based on the issuer ID and currency.RepoCurveDiscountFactorsrepoCurveDiscountFactors(SecurityId securityId, LegalEntityId issuerId, Currency currency)Gets the discount factors from a repo curve based on the security ID, issuer ID and currency.ImmutableLegalEntityDiscountingProvider.BuildertoBuilder()Returns a builder that allows this bean to be mutated.ImmutableLegalEntityDiscountingProvidertoImmutableLegalEntityDiscountingProvider()Converts this provider to an equivalentImmutableLegalEntityDiscountingProvider.StringtoString()
-
-
-
Method Detail
-
repoCurveDiscountFactors
public RepoCurveDiscountFactors repoCurveDiscountFactors(SecurityId securityId, LegalEntityId issuerId, Currency currency)
Description copied from interface:LegalEntityDiscountingProviderGets the discount factors from a repo curve based on the security ID, issuer ID and currency.This searches first for a curve associated with the security iD and currency, and then for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Specified by:
repoCurveDiscountFactorsin interfaceLegalEntityDiscountingProvider- Parameters:
securityId- the standard ID of security to get the discount factors forissuerId- the standard ID of legal entity to get the discount factors forcurrency- the currency to get the discount factors for- Returns:
- the discount factors
-
repoCurveDiscountFactors
public RepoCurveDiscountFactors repoCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Description copied from interface:LegalEntityDiscountingProviderGets the discount factors from a repo curve based on the issuer ID and currency.This searches for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Specified by:
repoCurveDiscountFactorsin interfaceLegalEntityDiscountingProvider- Parameters:
issuerId- the standard ID of legal entity to get the discount factors forcurrency- the currency to get the discount factors for- Returns:
- the discount factors
-
issuerCurveDiscountFactors
public IssuerCurveDiscountFactors issuerCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Description copied from interface:LegalEntityDiscountingProviderGets the discount factors from an issuer based on the issuer ID and currency.This searches for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Specified by:
issuerCurveDiscountFactorsin interfaceLegalEntityDiscountingProvider- Parameters:
issuerId- the standard ID to get the discount factors forcurrency- the currency to get the discount factors for- Returns:
- the discount factors
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Description copied from interface:LegalEntityDiscountingProviderComputes the parameter sensitivity.This computes the
CurrencyParameterSensitivitiesassociated with thePointSensitivities. This corresponds to the projection of the point sensitivity to the curve internal parameters representation.This method handles
RepoCurveZeroRateSensitivityandIssuerCurveZeroRateSensitivity. For other sensitivity objects, seeRatesProvider.parameterSensitivity(PointSensitivities).- Specified by:
parameterSensitivityin interfaceLegalEntityDiscountingProvider- Parameters:
pointSensitivities- the point sensitivity- Returns:
- the sensitivity to the curve parameters
-
data
public <T> T data(MarketDataId<T> id)
Description copied from interface:LegalEntityDiscountingProviderGets market data of a specific type.This is a general purpose mechanism to obtain market data. In general, it is desirable to pass the specific market data needed for pricing into the pricing method. However, in some cases, notably swaps, this is not feasible. It is strongly recommended to clearly state on pricing methods what data is required.
- Specified by:
datain interfaceLegalEntityDiscountingProvider- Type Parameters:
T- the type of the value- Parameters:
id- the identifier to find- Returns:
- the data associated with the key
-
findData
public <T> Optional<T> findData(MarketDataName<T> name)
Description copied from interface:LegalEntityDiscountingProviderFinds the market data with the specified name.This is most commonly used to find a
Curveusing aCurveName. If the market data cannot be found, empty is returned.- Specified by:
findDatain interfaceLegalEntityDiscountingProvider- Type Parameters:
T- the type of the market data value- Parameters:
name- the name to find- Returns:
- the market data value, empty if not found
-
toImmutableLegalEntityDiscountingProvider
public ImmutableLegalEntityDiscountingProvider toImmutableLegalEntityDiscountingProvider()
Description copied from interface:LegalEntityDiscountingProviderConverts this provider to an equivalentImmutableLegalEntityDiscountingProvider.- Specified by:
toImmutableLegalEntityDiscountingProviderin interfaceLegalEntityDiscountingProvider- Returns:
- the equivalent immutable legal entity provider
-
meta
public static ImmutableLegalEntityDiscountingProvider.Meta meta()
The meta-bean forImmutableLegalEntityDiscountingProvider.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableLegalEntityDiscountingProvider.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableLegalEntityDiscountingProvider.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getValuationDate
public LocalDate getValuationDate()
Gets the valuation date. All curves and other data items in this provider are calibrated for this date.- Specified by:
getValuationDatein interfaceLegalEntityDiscountingProvider- Returns:
- the value of the property, not null
-
getRepoCurveSecurityGroups
public ImmutableMap<SecurityId,RepoGroup> getRepoCurveSecurityGroups()
Gets the groups used to find a repo curve by security.This maps the security ID to a group. The group is used to find the curve in
repoCurves.- Returns:
- the value of the property, not null
-
getRepoCurveGroups
public ImmutableMap<LegalEntityId,RepoGroup> getRepoCurveGroups()
Gets the groups used to find a repo curve by legal entity.This maps the legal entity ID to a group. The group is used to find the curve in
repoCurves.- Returns:
- the value of the property, not null
-
getRepoCurves
public ImmutableMap<Pair<RepoGroup,Currency>,DiscountFactors> getRepoCurves()
Gets the repo curves, keyed by group and currency. The curve data, predicting the future, associated with each repo group and currency.- Returns:
- the value of the property, not null
-
getIssuerCurveGroups
public ImmutableMap<LegalEntityId,LegalEntityGroup> getIssuerCurveGroups()
Gets the groups used to find an issuer curve by legal entity.This maps the legal entity ID to a group. The group is used to find the curve in
issuerCurves.This property was renamed in version 1.1 of Strata from
legalEntityMap.- Returns:
- the value of the property, not null
-
getIssuerCurves
public ImmutableMap<Pair<LegalEntityGroup,Currency>,DiscountFactors> getIssuerCurves()
Gets the issuer curves, keyed by group and currency. The curve data, predicting the future, associated with each legal entity group and currency.- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableLegalEntityDiscountingProvider.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-