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)
  • Field Details

  • Constructor Details

    • ObjectExpressionVariable

      public ObjectExpressionVariable()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface ExpressionVariable
      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:
      1. The object is null
      2. The object is a Collection or array and the collection or array is empty (no items)
      3. 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'
    • isNotEmpty

      public boolean isNotEmpty(@Nullable Object o)
      The opposite of isEmpty(Object)
      Parameters:
      o - the object to check
      Returns:
      whether or not the given object is 'empty'