R- the result type expressed in a single currency
public 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.
Implementations do not have to be immutable, but calls to the method must be thread-safe.
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 result
rateProvider- the provider of FX rates
RuntimeException- if no FX rate could be found
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.