Package org.wildfly.common.format
Class GeneralFlags
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- org.wildfly.common.flags.Flags<E,This>
-
- org.wildfly.common.format.GeneralFlags
-
- All Implemented Interfaces:
java.lang.Iterable<GeneralFlag>,java.util.Collection<GeneralFlag>,java.util.Set<GeneralFlag>,java.util.SortedSet<GeneralFlag>
public final class GeneralFlags extends Flags<E,This>
-
-
Field Summary
Fields Modifier and Type Field Description static GeneralFlagsNONEThe empty set of general flags.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GeneralFlagcastItemOrNull(java.lang.Object obj)Get the item (cast to the correctenumtype), ornullif it is not of the correct type.protected GeneralFlagscastThis(java.lang.Object obj)Cast the given object to this class, throwing an exception if the cast fails.voidforbid(E flag)voidforbidAll()voidforbidAllBut(E flag)protected GeneralFlagitemOf(int index)Get the flag item with the given index.static GeneralFlagsof(GeneralFlag flag)static GeneralFlagsof(GeneralFlag flag1, GeneralFlag flag2)static GeneralFlagsof(GeneralFlag flag1, GeneralFlag flag2, GeneralFlag flag3)protected GeneralFlagsthis_()Returnthis.protected GeneralFlagsvalue(int bits)Get the set value of the given bit combination.-
Methods inherited from class org.wildfly.common.flags.Flags
comparator, complement, contains, contains, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, descendingIterator, equals, equals, equals, first, forEach, hashCode, headSet, isEmpty, iterator, last, size, subSet, tailSet, toArray, toArray, toString, with, with, with, with, with, without, without
-
-
-
-
Field Detail
-
NONE
public static final GeneralFlags NONE
The empty set of general flags.
-
-
Method Detail
-
of
public static GeneralFlags of(GeneralFlag flag)
-
of
public static GeneralFlags of(GeneralFlag flag1, GeneralFlag flag2)
-
of
public static GeneralFlags of(GeneralFlag flag1, GeneralFlag flag2, GeneralFlag flag3)
-
this_
protected GeneralFlags this_()
Description copied from class:FlagsReturnthis.- Specified by:
this_in classFlags<GeneralFlag,GeneralFlags>- Returns:
this
-
value
protected GeneralFlags value(int bits)
Description copied from class:FlagsGet the set value of the given bit combination. The bit combination may contain extraneous one-bits so any bits beyond the bit of the last flag should be masked off if an array is used for lookup.- Specified by:
valuein classFlags<GeneralFlag,GeneralFlags>- Parameters:
bits- the bit combination (possibly with extra bits)- Returns:
- the set instance
-
itemOf
protected GeneralFlag itemOf(int index)
Description copied from class:FlagsGet the flag item with the given index.- Specified by:
itemOfin classFlags<GeneralFlag,GeneralFlags>- Parameters:
index- the index- Returns:
- the flag
-
castItemOrNull
protected GeneralFlag castItemOrNull(java.lang.Object obj)
Description copied from class:FlagsGet the item (cast to the correctenumtype), ornullif it is not of the correct type.- Specified by:
castItemOrNullin classFlags<GeneralFlag,GeneralFlags>- Parameters:
obj- the object to cast- Returns:
- the cast object, or
null
-
castThis
protected GeneralFlags castThis(java.lang.Object obj)
Description copied from class:FlagsCast the given object to this class, throwing an exception if the cast fails.- Specified by:
castThisin classFlags<GeneralFlag,GeneralFlags>- Parameters:
obj- the object to cast- Returns:
- the cast object
-
forbidAll
public final void forbidAll()
-
forbidAllBut
public final void forbidAllBut(E flag)
-
forbid
public void forbid(E flag)
-
-