Package com.helger.commons.state
Enum EEnabled
- java.lang.Object
-
- java.lang.Enum<EEnabled>
-
- com.helger.commons.state.EEnabled
-
- All Implemented Interfaces:
IEnabledIndicator,Serializable,Comparable<EEnabled>
public enum EEnabled extends Enum<EEnabled> implements IEnabledIndicator
Small enum for setter method to identify whether an object is enabled or not.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEnabled()static EEnabledvalueOf(boolean bEnabled)Returns the enum constant of this type with the specified name.static EEnabledvalueOf(IEnabledIndicator aEnabledIndicator)Returns the enum constant of this type with the specified name.static EEnabledvalueOf(String name)Returns the enum constant of this type with the specified name.static EEnabled[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.helger.commons.state.IEnabledIndicator
and, isDisabled, or
-
-
-
-
Method Detail
-
values
public static EEnabled[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EEnabled c : EEnabled.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EEnabled valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceIEnabledIndicator- Returns:
trueif the object is currently enabled,falseotherwise.
-
valueOf
@Nonnull public static EEnabled valueOf(boolean bEnabled)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
bEnabled- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
valueOf
@Nonnull public static EEnabled valueOf(@Nonnull IEnabledIndicator aEnabledIndicator)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
aEnabledIndicator- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
-