Package de.xima.fc.bitflag
Class BitFlagSetPredicate
- java.lang.Object
-
- de.xima.fc.bitflag.BitFlagSetPredicate
-
- All Implemented Interfaces:
Serializable
,LongPredicate
@Immutable public final class BitFlagSetPredicate extends Object implements Serializable, LongPredicate
Apredicate
for checking whether a bit flag includes or excludes some or all of a given set of flags.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BitFlagSetPredicate.Builder
Builder for aBitFlagSetPredicate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BitFlagSetPredicate.Builder
builder()
boolean
equals(Object obj)
static BitFlagSetPredicate
equalTo(long flags)
int
hashCode()
static BitFlagSetPredicate
matchAll()
static BitFlagSetPredicate
matchNone()
boolean
test(long flag)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.LongPredicate
and, negate, or
-
-
-
-
Method Detail
-
test
public boolean test(long flag)
- Specified by:
test
in interfaceLongPredicate
-
builder
public static BitFlagSetPredicate.Builder builder()
- Returns:
- A builder for a
BitFlagSetPredicate
. By default, it includes no constraints.Building
an empty builder is equivalent tomatchAll()
.
-
equalTo
public static BitFlagSetPredicate equalTo(long flags)
- Parameters:
flags
- Types to match.- Returns:
- A predicate that matches only the exact given value, i.e. when a flag include all of the given flags and excludes all other flags.
-
matchAll
public static BitFlagSetPredicate matchAll()
- Returns:
- A predicate that matches all flags.
-
matchNone
public static BitFlagSetPredicate matchNone()
- Returns:
- A predicate that matches no flags.
-
-