R - the result type expressed in a single currencypublic interface FxConvertible<R>
The single method allows a monetary object to be converted to a similar object expressed in terms of the specified currency. The conversion is permitted to return a different type.
For example, the MultiCurrencyAmount class implements this interface
and returns a CurrencyAmount instance.
Implementations do not have to be immutable, but calls to the method must be thread-safe.
| Modifier and Type | Method and Description |
|---|---|
R |
convertedTo(Currency resultCurrency,
FxRateProvider rateProvider)
Converts this instance to an equivalent amount in the specified currency.
|
R convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
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.
resultCurrency - the currency of the resultrateProvider - the provider of FX ratesRuntimeException - if no FX rate could be foundCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.