Class LocaleExpressionVariable
- java.lang.Object
-
- com.broadleafcommerce.rulesengine.expression.util.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 Summary
Constructors Constructor Description LocaleExpressionVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Locale locale, String localeString)
Checks if locales are equal.String
getName()
boolean
notEquals(Locale locale, String localeString)
Checks if locales are not equal.
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceExpressionVariable
- Returns:
- Name of the variable, must not be null
-
equals
public final boolean equals(@Nullable Locale locale, String localeString)
Checks if locales are equal.- Parameters:
locale
- the locale to be comparedlocaleString
- the locale in IETF or POSIX to compare to- Returns:
- true if locale is equal to the specified localeString
-
-