Class ConstantRecoveryRates
- java.lang.Object
-
- com.opengamma.strata.pricer.credit.ConstantRecoveryRates
-
- All Implemented Interfaces:
MarketDataView,ParameterizedData,RecoveryRates,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ConstantRecoveryRates extends Object implements RecoveryRates, org.joda.beans.ImmutableBean, Serializable
The constant recovery rate.The recovery rate is constant for any given date.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConstantRecoveryRates.MetaThe meta-bean forConstantRecoveryRates.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)<T> Optional<T>findData(MarketDataName<T> name)Finds the market data with the specified name.StandardIdgetLegalEntityId()Gets the legal entity identifier.doublegetParameter(int parameterIndex)Gets the value of the parameter at the specified index.intgetParameterCount()Gets the number of parameters.ParameterMetadatagetParameterMetadata(int parameterIndex)Gets the metadata of the parameter at the specified index.doublegetRecoveryRate()Gets the recovery rate.LocalDategetValuationDate()Gets the valuation date.inthashCode()static ConstantRecoveryRates.Metameta()The meta-bean forConstantRecoveryRates.ConstantRecoveryRates.MetametaBean()static ConstantRecoveryRatesof(StandardId legalEntityId, LocalDate valuationDate, double recoveryRate)Obtains an instance.doublerecoveryRate(LocalDate date)Gets the recovery rate for the specified date.StringtoString()ConstantRecoveryRateswithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.ConstantRecoveryRateswithPerturbation(ParameterPerturbation perturbation)Returns a perturbed copy of the data.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.market.param.ParameterizedData
findParameterIndex
-
-
-
-
Method Detail
-
of
public static ConstantRecoveryRates of(StandardId legalEntityId, LocalDate valuationDate, double recoveryRate)
Obtains an instance.- Parameters:
legalEntityId- the legal entity identifiervaluationDate- the valuation daterecoveryRate- the recovery rate- Returns:
- the instance
-
recoveryRate
public double recoveryRate(LocalDate date)
Description copied from interface:RecoveryRatesGets the recovery rate for the specified date.- Specified by:
recoveryRatein interfaceRecoveryRates- Parameters:
date- the date- Returns:
- the recovery rate
-
findData
public <T> Optional<T> findData(MarketDataName<T> name)
Description copied from interface:MarketDataViewFinds the market data with the specified name.This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.
- Specified by:
findDatain interfaceMarketDataView- 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
-
getParameterCount
public int getParameterCount()
Description copied from interface:ParameterizedDataGets the number of parameters.This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
- Specified by:
getParameterCountin interfaceParameterizedData- Returns:
- the number of parameters
-
getParameter
public double getParameter(int parameterIndex)
Description copied from interface:ParameterizedDataGets the value of the parameter at the specified index.- Specified by:
getParameterin interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the value of the parameter
-
getParameterMetadata
public ParameterMetadata getParameterMetadata(int parameterIndex)
Description copied from interface:ParameterizedDataGets the metadata of the parameter at the specified index.If there is no specific parameter metadata, an empty instance will be returned.
- Specified by:
getParameterMetadatain interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the metadata of the parameter
-
withParameter
public ConstantRecoveryRates withParameter(int parameterIndex, double newValue)
Description copied from interface:ParameterizedDataReturns a copy of the data with the value at the specified index altered.This instance is immutable and unaffected by this method call.
- Specified by:
withParameterin interfaceParameterizedData- Specified by:
withParameterin interfaceRecoveryRates- Parameters:
parameterIndex- the zero-based index of the parameter to getnewValue- the new value for the specified parameter- Returns:
- a parameterized data instance based on this with the specified parameter altered
-
withPerturbation
public ConstantRecoveryRates withPerturbation(ParameterPerturbation perturbation)
Description copied from interface:ParameterizedDataReturns a perturbed copy of the data.The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
- Specified by:
withPerturbationin interfaceParameterizedData- Specified by:
withPerturbationin interfaceRecoveryRates- Parameters:
perturbation- the perturbation to apply- Returns:
- a parameterized data instance based on this with the specified perturbation applied
-
meta
public static ConstantRecoveryRates.Meta meta()
The meta-bean forConstantRecoveryRates.- Returns:
- the meta-bean, not null
-
metaBean
public ConstantRecoveryRates.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getLegalEntityId
public StandardId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the reference legal entity of a credit derivative.
- Specified by:
getLegalEntityIdin interfaceRecoveryRates- Returns:
- the value of the property, not null
-
getValuationDate
public LocalDate getValuationDate()
Gets the valuation date.- Specified by:
getValuationDatein interfaceMarketDataView- Specified by:
getValuationDatein interfaceRecoveryRates- Returns:
- the value of the property, not null
-
getRecoveryRate
public double getRecoveryRate()
Gets the recovery rate.The recovery rate is represented in decimal form, and must be between 0 and 1 inclusive.
- Returns:
- the value of the property
-
-