Interface FxConvertible<R>

    • Method Detail

      • convertedTo

        R convertedTo​(Currency resultCurrency,
                      FxRateProvider rateProvider)
        Converts this instance to an equivalent amount in the specified currency.

        The result, which may be of a different type, will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.

        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
        Throws:
        java.lang.RuntimeException - if no FX rate could be found