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
A
predicate 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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BitFlagSetPredicate.Builderbuilder()booleanstatic BitFlagSetPredicateequalTo(long flags) inthashCode()static BitFlagSetPredicatematchAll()static BitFlagSetPredicatebooleantest(long flag) Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LongPredicate
and, negate, or
-
Method Details
-
equals
-
hashCode
-
test
public boolean test(long flag) - Specified by:
testin interfaceLongPredicate
-
builder
- Returns:
- A builder for a
BitFlagSetPredicate. By default, it includes no constraints.Buildingan empty builder is equivalent tomatchAll().
-
equalTo
- 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
- Returns:
- A predicate that matches all flags.
-
matchNone
- Returns:
- A predicate that matches no flags.
-