@NotThreadSafe public class FlagContainer extends Object implements IFlagContainer
IFlagContainer.| Constructor and Description |
|---|
FlagContainer() |
FlagContainer(Collection<String> aValues) |
FlagContainer(IReadonlyFlagContainer aCont) |
FlagContainer(String... aValues) |
| Modifier and Type | Method and Description |
|---|---|
EChange |
addFlag(String sName)
Add a flag if it is not yet present.
|
EChange |
addFlags(Collection<String> aValues)
Add an arbitrary number of flags if they are not yet present.
|
EChange |
addFlags(String... aValues)
Add an arbitrary number of flags if they are not yet present.
|
EChange |
clear()
Reset the contents of the element to the after-construction state.
|
boolean |
containsFlag(String sName)
Check if an flag of the given name is contained.
|
boolean |
containsNoFlag() |
boolean |
equals(Object o) |
Set<String> |
getAllFlags() |
int |
getFlagCount() |
int |
hashCode() |
EChange |
removeFlag(String sName)
Remove the specified flag from the container.
|
String |
toString() |
public FlagContainer()
public FlagContainer(@Nonnull Collection<String> aValues)
public FlagContainer(@Nonnull IReadonlyFlagContainer aCont)
public boolean containsFlag(@Nullable String sName)
IReadonlyFlagContainercontainsFlag in interface IReadonlyFlagContainersName - name of the flag to checktrue if the flag is contained, false
otherwise@Nonnull @ReturnsMutableCopy public Set<String> getAllFlags()
getAllFlags in interface IReadonlyFlagContainernull set with all contained flags.@Nonnull public EChange addFlag(@Nonnull String sName)
IFlagContaineraddFlag in interface IFlagContainersName - The name of the flag. May not be null.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.IFlagContainer.removeFlag(String)@Nonnull public final EChange addFlags(@Nullable Collection<String> aValues)
IFlagContaineraddFlags in interface IFlagContaineraValues - The collections of flags to be set. May be null.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.IFlagContainer.addFlag(String)@Nonnull public final EChange addFlags(@Nullable String... aValues)
IFlagContaineraddFlags in interface IFlagContaineraValues - The collections of flags to be set. May be null.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.IFlagContainer.addFlag(String)@Nonnull public EChange removeFlag(@Nullable String sName)
IFlagContainerremoveFlag in interface IFlagContainersName - The flag name to be removed. If it is null nothing
happens.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.@Nonnegative public int getFlagCount()
getFlagCount in interface IReadonlyFlagContainerpublic boolean containsNoFlag()
containsNoFlag in interface IReadonlyFlagContainertrue if this flag container does not contain any flag
at all, false if at least one flag is contained.@Nonnull public EChange clear()
IClearableclear in interface IClearableEChange.CHANGED if at least one element was cleared,
EChange.UNCHANGED otherwise.Copyright © 2006–2014 phloc systems. All rights reserved.