Package cdc.util.cli
Class FeatureMask<E extends Enum<E>>
- java.lang.Object
-
- cdc.util.cli.FeatureMask<E>
-
-
Constructor Summary
Constructors Constructor Description FeatureMask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(E feature)voidaddAll(FeatureMask<E> mask)voidaddAll(E... features)voidaddAll(Collection<E> features)booleancheckAtMostOne(org.apache.logging.log4j.Logger logger, FailureReaction reaction, E... features)Check that at most one feature is enabled in a group of features.booleancheckExactlyOne(org.apache.logging.log4j.Logger logger, FailureReaction reaction, E... features)Check that exactly one feature is enabled in a group of features.booleancontains(E feature)booleanisEmpty()booleanisEnabled(E feature)voidremove(E feature)voidsetEnabled(E feature, boolean enabled)List<E>toList()Set<E>toSet()
-
-
-
Method Detail
-
setEnabled
public final void setEnabled(E feature, boolean enabled)
-
add
public final void add(E feature)
-
addAll
@SafeVarargs public final void addAll(E... features)
-
addAll
public final void addAll(Collection<E> features)
-
addAll
public final void addAll(FeatureMask<E> mask)
-
remove
public final void remove(E feature)
-
isEnabled
public final boolean isEnabled(E feature)
-
isEmpty
public boolean isEmpty()
-
contains
public final boolean contains(E feature)
-
checkAtMostOne
@SafeVarargs public final boolean checkAtMostOne(org.apache.logging.log4j.Logger logger, FailureReaction reaction, E... features)
Check that at most one feature is enabled in a group of features.- Parameters:
logger- The logger to use.reaction- The reaction to adopt in case of failure.features- The features.- Returns:
trueif at most one feature amongfeaturesis enabled in this FeatureMask.
-
checkExactlyOne
@SafeVarargs public final boolean checkExactlyOne(org.apache.logging.log4j.Logger logger, FailureReaction reaction, E... features)
Check that exactly one feature is enabled in a group of features.- Parameters:
logger- The logger to use.reaction- The reaction to adopt in case of failure.features- The features.- Returns:
trueif exactly one feature amongfeaturesis enabled in this FeatureMask.
-
-