Package adams.core.option
Enum UserMode
- java.lang.Object
-
- java.lang.Enum<UserMode>
-
- adams.core.option.UserMode
-
- All Implemented Interfaces:
EnumWithCustomDisplay<UserMode>
,EnumWithCustomParsing<UserMode>
,Serializable
,Comparable<UserMode>
public enum UserMode extends Enum<UserMode> implements EnumWithCustomDisplay<UserMode>
The user mode, determines the knowledge level of the user.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isAtLeast(UserMode mode, UserMode minMode)
Checks whether the given user mode is at least the specified minimum.UserMode
parse(String s)
Parses the given string and returns the associated enum.String
toDisplay()
Returns the display string.String
toRaw()
Returns the raw enum string.String
toString()
Returns the display string.static UserMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static UserMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static UserMode[] 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 (UserMode c : UserMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static UserMode 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
-
toDisplay
public String toDisplay()
Returns the display string.- Specified by:
toDisplay
in interfaceEnumWithCustomDisplay<UserMode>
- Returns:
- the display string
-
toRaw
public String toRaw()
Returns the raw enum string.- Specified by:
toRaw
in interfaceEnumWithCustomDisplay<UserMode>
- Returns:
- the raw enum string
-
toString
public String toString()
Returns the display string.
-
parse
public UserMode parse(String s)
Parses the given string and returns the associated enum.- Specified by:
parse
in interfaceEnumWithCustomParsing<UserMode>
- Parameters:
s
- the string to parse- Returns:
- the enum or null if not found
-
-