Class LocaleExpressionVariable

  • All Implemented Interfaces:
    ExpressionVariable

    public class LocaleExpressionVariable
    extends Object
    implements ExpressionVariable

    Common operations for locale comparison

    The methods in this class expect the compared locale to be in either IETF (with dash, i.e., "en-US"), POSIX (with underscore, i.e., "en_US"), or simply the language, i.e., "en".

    An instance of this class will usually be accessible as a variable within an expression via #locales.

    Author:
    Chad Harchar (charchar)
    • Constructor Detail

      • LocaleExpressionVariable

        public LocaleExpressionVariable()
    • Method Detail

      • equals

        public final boolean equals​(@Nullable
                                    Locale locale,
                                    String localeString)
        Checks if locales are equal.
        Parameters:
        locale - the locale to be compared
        localeString - the locale in IETF or POSIX to compare to
        Returns:
        true if locale is equal to the specified localeString
      • notEquals

        public final boolean notEquals​(@Nullable
                                       Locale locale,
                                       String localeString)
        Checks if locales are not equal.
        Parameters:
        locale - the locale to be compared
        localeString - the locale in IETF or POSIX to compare to
        Returns:
        true if locale is not equal to the specified localeString