Package org.instancio
Class When
java.lang.Object
org.instancio.When
Provides convenience methods for creating
Predicates
.- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Predicate
<T> is
(T value) A predicate that returnstrue
if values are equal usingObjects.equals(Object, Object)
.static <T> Predicate
<T> isIn
(T... values) A predicate that checks whether a value is equal to any element in thevalues
array usingObjects.equals(Object, Object)
.static <T> Predicate
<T> isNot
(T value) A predicate that returnstrue
if values are not equal usingObjects.equals(Object, Object)
.static <T> Predicate
<T> A predicate that checks if a value is notnull
.static <T> Predicate
<T> isNull()
A predicate that checks if a value isnull
.
-
Method Details
-
is
A predicate that returnstrue
if values are equal usingObjects.equals(Object, Object)
.- Type Parameters:
T
- value type- Parameters:
value
- to compare with- Returns:
- predicate that checks that values are equal
- Since:
- 3.0.0
-
isNot
A predicate that returnstrue
if values are not equal usingObjects.equals(Object, Object)
.- Type Parameters:
T
- value type- Parameters:
value
- to compare with- Returns:
- predicate that checks that values are not equal
- Since:
- 3.0.0
-
isNull
A predicate that checks if a value isnull
.- Type Parameters:
T
- value type- Returns:
- predicate that checks if a value is
null
- Since:
- 3.0.0
-
isNotNull
A predicate that checks if a value is notnull
.- Type Parameters:
T
- value type- Returns:
- predicate that checks if a value is not
null
- Since:
- 3.0.0
-
isIn
A predicate that checks whether a value is equal to any element in thevalues
array usingObjects.equals(Object, Object)
.- Type Parameters:
T
- value type- Parameters:
values
- to compare with- Returns:
- predicate that checks if a value is equal to any element of the input array
- Since:
- 3.0.0
-