Interface CurrencyConversionService

All Known Implementing Classes:
DefaultCurrencyConversionService, NoOpCurrencyConversionService

public interface CurrencyConversionService
Implementations of this service provide support for currency conversions.
Author:
Brian Polster (bpolster)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)
    Determine if conversion support is available based on a currencyCode from and to.
    javax.money.MonetaryAmount
    convert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)
    Return a MonetaryAmount by applying a currency conversion from the fromAmount to the target currency.
  • Method Details

    • canCovert

      boolean canCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)
      Determine if conversion support is available based on a currencyCode from and to.
      Parameters:
      from - The currency to convert from.
      to - The currency to convert to.
      Returns:
    • convert

      javax.money.MonetaryAmount convert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)
      Return a MonetaryAmount by applying a currency conversion from the fromAmount to the target currency.
      Parameters:
      fromAmount - The MonetaryAmount to convert.
      toCurrency - The currency to convert to.
      Returns:
      A MonetaryAmount in the target currency.