Module java.money

Class AmountFormatQuery

  • All Implemented Interfaces:
    java.io.Serializable

    public final class AmountFormatQuery
    extends AbstractQuery
    Query for accessing instances of MonetaryAmountFormat. In general it is determined by the implementation, what formats are provided. Nevertheless the following queries must be supported:
    • Accessing a format based on a Locale, that is also supported by .DecimalFormat#getAvailableLocales().
    All other formats are optional. For further details about supported formats refer to the implementation's documentation.

    This class is immutable, thread-safe and serializable.

    See Also:
    Serialized Form
    • Method Detail

      • getFormatName

        public java.lang.String getFormatName()
        Gets a style's id.
        Returns:
        the styleId, or null.
      • getLocale

        public java.util.Locale getLocale()
        Gets a Locale to be applied.
        Returns:
        the style's locale, or null.
      • of

        public static AmountFormatQuery of​(java.util.Locale locale,
                                           java.lang.String... providers)
        Creates a simple format query based on a single Locale, similar to (java.util.Locale).
        Parameters:
        locale - the target locale, not null.
        providers - the providers to be used, not null.
        Returns:
        a new query instance