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:
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • test

      public boolean test(long flag)
      Specified by:
      test in interface LongPredicate
    • builder

      public static BitFlagSetPredicate.Builder builder()
      Returns:
      A builder for a BitFlagSetPredicate. By default, it includes no constraints. Building an empty builder is equivalent to matchAll().
    • 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.