Class CollectionExpressionVariable
- All Implemented Interfaces:
ExpressionVariable
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 around CollectionUtils to provide a layer
of abstraction and because CollectionUtils employs static methods. Note that not all methods of
CollectionUtils have been implemented just those that seemed most relevant for expression
evaluation.
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> booleancontains(Collection<T> collection, T value) Deprecated.booleancontainsAll(Collection<?> coll1, Collection<?> coll2) Deprecated.Whether the first collection contains all of the elements from the second.booleancontainsAny(Collection<?> coll1, Collection<?> coll2) Deprecated.Whether the first collection contains any elements from the second.booleancontainsNone(Collection<?> coll1, Collection<?> coll2) Deprecated.Whether the first collections contains none of the elements form the second.booleanequals(Collection<?> coll1, Collection<?> coll2) Deprecated.Performs a deep equals on the 2 collections.getName()Deprecated.booleanisEmpty(Collection<?> collection) Deprecated.Whether the collection is empty or null.<T> booleannotContains(Collection<T> collection, Collection<T> value) Deprecated.Whether the collection defined byvalueis not contained by the collection.<T> booleannotContains(Collection<T> collection, T value) Deprecated.Whether the value is not contained by the collection.<T> booleannotContains(Collection<T> collection, T[] value) Deprecated.Whether the array defined byvalueis not contained by the collection.
-
Field Details
-
NAME
Deprecated.- See Also:
-
-
Constructor Details
-
CollectionExpressionVariable
public CollectionExpressionVariable()Deprecated.
-
-
Method Details
-
getName
Deprecated.- Specified by:
getNamein interfaceExpressionVariable- Returns:
- Name of the variable, must not be null
-
isEmpty
Deprecated.Whether the collection is empty or null. -
equals
Deprecated.Performs a deep equals on the 2 collections. -
contains
Deprecated.Whether the
valueis found within thecollectionusingCollection.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 ofvalueare traversed to see if all of the elements are contained withincollection. Ifvalueis null, then thecollectionmust 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
valueis contained withincollection
-
notContains
Deprecated.Whether the value is not contained by the collection. -
notContains
Deprecated.Whether the collection defined byvalueis not contained by the collection. -
notContains
Deprecated.Whether the array defined byvalueis not contained by the collection. -
containsAny
Deprecated.Whether the first collection contains any elements from the second. If either is null, returns false. -
containsAll
Deprecated.Whether the first collection contains all of the elements from the second. If both are empty or null, returns true -
containsNone
Deprecated.Whether the first collections contains none of the elements form the second. If either is null, returns true.
-
CollectionsExpressionVariable. Note that the inputs have been reversed for methods with more than one.