Class ConstantRecoveryRates

    • Method Detail

      • of

        public static ConstantRecoveryRates of​(StandardId legalEntityId,
                                               LocalDate valuationDate,
                                               double recoveryRate)
        Obtains an instance.
        Parameters:
        legalEntityId - the legal entity identifier
        valuationDate - the valuation date
        recoveryRate - the recovery rate
        Returns:
        the instance
      • recoveryRate

        public double recoveryRate​(LocalDate date)
        Description copied from interface: RecoveryRates
        Gets the recovery rate for the specified date.
        Specified by:
        recoveryRate in interface RecoveryRates
        Parameters:
        date - the date
        Returns:
        the recovery rate
      • findData

        public <T> Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: MarketDataView
        Finds 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:
        findData in interface MarketDataView
        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: ParameterizedData
        Gets 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:
        getParameterCount in interface ParameterizedData
        Returns:
        the number of parameters
      • getParameter

        public double getParameter​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the value of the parameter at the specified index.
        Specified by:
        getParameter in interface ParameterizedData
        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: ParameterizedData
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Specified by:
        getParameterMetadata in interface ParameterizedData
        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: ParameterizedData
        Returns 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:
        withParameter in interface ParameterizedData
        Specified by:
        withParameter in interface RecoveryRates
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        newValue - 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: ParameterizedData
        Returns 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:
        withPerturbation in interface ParameterizedData
        Specified by:
        withPerturbation in interface RecoveryRates
        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 for ConstantRecoveryRates.
        Returns:
        the meta-bean, not null
      • getLegalEntityId

        public StandardId getLegalEntityId()
        Gets the legal entity identifier.

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

        Specified by:
        getLegalEntityId in interface RecoveryRates
        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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object