Module java.money

Interface CurrencyProviderSpi


public interface CurrencyProviderSpi
SPI (core) to be registered using the Bootstrap, which allows to register/provide additional currencies into the system automatically on startup. The implementation is allowed to be implemented in y contextual way, so depending on the runtime context, different currencies may be available.
  • Method Details

    • getProviderName

      default String getProviderName()
      The unique name of this currency provider instance.
      Returns:
      the unique provider id, never null or empty.
    • isCurrencyAvailable

      default boolean isCurrencyAvailable(CurrencyQuery query)
      Checks if a CurrencyUnit instances matching the given CurrencyContext is available from this provider.
      Parameters:
      query - the CurrencyQuery containing the parameters determining the query. not null.
      Returns:
      false, if no such unit is provided by this provider.
    • getCurrencies

      Set<CurrencyUnit> getCurrencies(CurrencyQuery query)
      Return a CurrencyUnit instances matching the given CurrencyContext.
      Parameters:
      query - the CurrencyQuery containing the parameters determining the query. not null.
      Returns:
      the corresponding CurrencyUnits matching, never null.