Package io.atomix.utils.misc
Class Match<T>
java.lang.Object
io.atomix.utils.misc.Match<T>
- Type Parameters:
T- type of value
Utility class for checking matching values.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Match<T>any()Returns a Match that matches any value including null.booleaninthashCode()static <T> Match<T>Returns a Match that matches all non-null values.static <T> Match<T>ifNotValue(T value) Returns a Match that matches any value except the specified value.static <T> Match<T>ifNull()Returns a Match that matches null values.static <T> Match<T>ifValue(T value) Returns a Match that only matches the specified value.<V> Match<V>Maps this instance to a Match of another type.booleanChecks if this instance matches specified value.toString()
-
Field Details
-
ANY
-
NULL
-
NOT_NULL
-
-
Method Details
-
any
Returns a Match that matches any value including null.- Type Parameters:
T- match type- Returns:
- new instance
-
ifNull
Returns a Match that matches null values.- Type Parameters:
T- match type- Returns:
- new instance
-
ifNotNull
Returns a Match that matches all non-null values.- Type Parameters:
T- match type- Returns:
- new instance
-
ifValue
Returns a Match that only matches the specified value.- Type Parameters:
T- match type- Parameters:
value- value to match- Returns:
- new instance
-
ifNotValue
Returns a Match that matches any value except the specified value.- Type Parameters:
T- match type- Parameters:
value- value to not match- Returns:
- new instance
-
map
Maps this instance to a Match of another type.- Type Parameters:
V- new match type- Parameters:
mapper- transformation function- Returns:
- new instance
-
matches
Checks if this instance matches specified value.- Parameters:
other- other value- Returns:
- true if matches; false otherwise
-
hashCode
public int hashCode() -
equals
-
toString
-