Class CollectionExpressionVariable
- java.lang.Object
-
- com.broadleafcommerce.rulesengine.expression.util.CollectionExpressionVariable
-
- All Implemented Interfaces:
ExpressionVariable
public class CollectionExpressionVariable extends Object implements ExpressionVariable
Deprecated.UseCollectionsExpressionVariable
. Note that the inputs have been reversed for methods with more than one.Common, null-safe, collection operations
An instance of this class will usually be accessible as a variable within an expression via
#collections
. This is partly a wrapper aroundCollectionUtils
to provide a layer of abstraction and because CollectionUtils employs static methods. Note that not all methods ofCollectionUtils
have been implemented just those that seemed most relevant for expression evaluation.- Author:
- Nathan Moore (nathandmoore)
-
-
Constructor Summary
Constructors Constructor Description CollectionExpressionVariable()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T> boolean
contains(Collection<T> collection, T value)
Deprecated.boolean
containsAll(Collection<?> coll1, Collection<?> coll2)
Deprecated.Whether the first collection contains all of the elements from the second.boolean
containsAny(Collection<?> coll1, Collection<?> coll2)
Deprecated.Whether the first collection contains any elements from the second.boolean
containsNone(Collection<?> coll1, Collection<?> coll2)
Deprecated.Whether the first collections contains none of the elements form the second.boolean
equals(Collection<?> coll1, Collection<?> coll2)
Deprecated.Performs a deep equals on the 2 collections.String
getName()
Deprecated.boolean
isEmpty(Collection<?> collection)
Deprecated.Whether the collection is empty or null.<T> boolean
notContains(Collection<T> collection, Collection<T> value)
Deprecated.Whether the collection defined byvalue
is not contained by the collection.<T> boolean
notContains(Collection<T> collection, T value)
Deprecated.Whether the value is not contained by the collection.<T> boolean
notContains(Collection<T> collection, T[] value)
Deprecated.Whether the array defined byvalue
is not contained by the collection.
-
-
-
Field Detail
-
NAME
public static final String NAME
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
Deprecated.- Specified by:
getName
in interfaceExpressionVariable
- Returns:
- Name of the variable, must not be null
-
isEmpty
public boolean isEmpty(@Nullable Collection<?> collection)
Deprecated.Whether the collection is empty or null.
-
equals
public boolean equals(@Nullable Collection<?> coll1, @Nullable Collection<?> coll2)
Deprecated.Performs a deep equals on the 2 collections.
-
contains
public <T> boolean contains(@Nullable Collection<T> collection, @Nullable T value)
Deprecated.Whether the
value
is found within thecollection
usingCollection.contains(Object)
. This method is dynamic and will work slightly differently when given an array or a collection to validate against. In that scenario, the contents ofvalue
are traversed to see if all of the elements are contained withincollection
. Ifvalue
is null, then thecollection
must contain a null value- Parameters:
collection
- collection to checkvalue
- what to check for, which can also be an array or collection- Returns:
- whether or not everything defined by
value
is contained withincollection
-
notContains
public <T> boolean notContains(@Nullable Collection<T> collection, @Nullable T value)
Deprecated.Whether the value is not contained by the collection.
-
notContains
public <T> boolean notContains(@Nullable Collection<T> collection, @Nullable Collection<T> value)
Deprecated.Whether the collection defined byvalue
is not contained by the collection.
-
notContains
public <T> boolean notContains(@Nullable Collection<T> collection, @Nullable T[] value)
Deprecated.Whether the array defined byvalue
is not contained by the collection.
-
containsAny
public boolean containsAny(@Nullable Collection<?> coll1, @Nullable Collection<?> coll2)
Deprecated.Whether the first collection contains any elements from the second. If either is null, returns false.
-
containsAll
public boolean containsAll(@Nullable Collection<?> coll1, @Nullable Collection<?> coll2)
Deprecated.Whether the first collection contains all of the elements from the second. If both are empty or null, returns true
-
containsNone
public boolean containsNone(@Nullable Collection<?> coll1, @Nullable Collection<?> coll2)
Deprecated.Whether the first collections contains none of the elements form the second. If either is null, returns true.
-
-