Class ObjectExpressionVariable
- java.lang.Object
-
- com.broadleafcommerce.rulesengine.expression.util.ObjectExpressionVariable
-
- All Implemented Interfaces:
ExpressionVariable
public class ObjectExpressionVariable extends Object implements ExpressionVariable
General object utilities- Author:
- Phillip Verheyden (phillipuniverse)
-
-
Constructor Summary
Constructors Constructor Description ObjectExpressionVariable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
boolean
isEmpty(Object o)
A given object is defined as 'empty' if the following is true: The object isnull
The object is a Collection or array and the collection or array is empty (no items) The object is a String and the string is empty (no characters)boolean
isNotEmpty(Object o)
The opposite ofisEmpty(Object)
-
-
-
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
-
isEmpty
public boolean isEmpty(@Nullable Object o)
A given object is defined as 'empty' if the following is true:- The object is
null
- The object is a Collection or array and the collection or array is empty (no items)
- The object is a String and the string is empty (no characters)
- Parameters:
o
- the object to check- Returns:
- whether or not the given object is 'empty'
- The object is
-
isNotEmpty
public boolean isNotEmpty(@Nullable Object o)
The opposite ofisEmpty(Object)
- Parameters:
o
- the object to check- Returns:
- whether or not the given object is 'empty'
-
-