Module java.money

Class ProviderContext

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ProviderContext
    extends AbstractContext
    This class describes what kind of ExchangeRates a .ExchangeRateProvider delivers, including the provider's name, rate type and additional data. By default such a context supports the following attributes:
    • a unique non localizable provider name. This provider name is also used to identify a concrete instance of ExchangeRateProvider.
    • a set of RateType an ExchangeRateProvider supports
    • a time range for which an ExchangeRateProvider delivers rates.
    Additionally a instance of ProviderContext can have arbitrary additional attributes describing more precisely the capabilities of a concrete ExchangeRateProvider} implementation.

    Instances of this class are immutable and thread-safe.

    Author:
    Anatole Tresch, Werner Keil
    See Also:
    Serialized Form
    • Method Detail

      • getRateTypes

        public java.util.Set<RateType> getRateTypes()
        Get the deferred flag. Exchange rates can be deferred or real.time.
        Returns:
        the deferred flag, or {code null}.
      • of

        public static ProviderContext of​(java.lang.String provider,
                                         RateType rateType,
                                         RateType... rateTypes)
        Creates a new ProviderContext based on the provider id and rate type(s).
        Parameters:
        provider - the provider id, not null.
        rateType - the required RateType, not null.
        rateTypes - the required RateTypes, not null
        Returns:
        a new ProviderContext instance.
      • of

        public static ProviderContext of​(java.lang.String provider)
        Creates a new ProviderContext based on the provider id and rate type(s).
        Parameters:
        provider - the provider id, not null.
        Returns:
        a new ProviderContext instance.