Class IdentityRateProvider

java.lang.Object
org.javamoney.moneta.spi.AbstractRateProvider
org.javamoney.moneta.convert.IdentityRateProvider
All Implemented Interfaces:
javax.money.convert.ExchangeRateProvider

public class IdentityRateProvider
extends AbstractRateProvider
This class implements an ExchangeRateProvider that provides exchange rate with factor one for identical base/term currencies.
Author:
Anatole Tresch, Werner Keil
  • Constructor Details

  • Method Details

    • isAvailable

      public boolean isAvailable​(javax.money.convert.ConversionQuery conversionQuery)
      Check if this provider can provide a rate, which is only the case if base and term are equal.
      Parameters:
      conversionQuery - the required ConversionQuery, not null
      Returns:
      true, if the contained base and term currencies are known to this provider.
    • getExchangeRate

      public javax.money.convert.ExchangeRate getExchangeRate​(javax.money.convert.ConversionQuery conversionQuery)
      Specified by:
      getExchangeRate in interface javax.money.convert.ExchangeRateProvider
      Specified by:
      getExchangeRate in class AbstractRateProvider
    • getReversed

      public javax.money.convert.ExchangeRate getReversed​(javax.money.convert.ExchangeRate rate)