public enum State extends Enum<State>
| Enum Constant and Description |
|---|
ABSTRACT
Type cannot be instantiated but can be extended
|
DEFAULT
Type can be instantiated and can be extended
|
FINAL
Type can be instantiated but can't be extended
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeInherited()
Check if type can be inherited
|
boolean |
canBeInstantiated()
Check if type can be instantiated
|
boolean |
isAbstract()
Utility method to compare state with
ABSTRACT |
static State |
of(Class<?> clazz)
Get state based on the given class (abstract/final/default)
|
static State |
of(String state)
|
static State |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static State[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final State ABSTRACT
public static final State DEFAULT
public static final State FINAL
public static State[] values()
for (State c : State.values()) System.out.println(c);
public static State valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean canBeInherited()
public boolean canBeInstantiated()
public boolean isAbstract()
ABSTRACTpublic static State of(Class<?> clazz)
clazz - the class to checkCopyright © 2020. All rights reserved.