public enum ColorEnum extends Enum<ColorEnum> implements NamedValueEnum<Color>
Enum Constant and Description |
---|
BLACK |
BLUE |
CYAN |
DARK_GRAY |
GRAY |
GREEN |
LIGHT_GRAY |
MAGENTA |
ORANGE |
PINK |
RED |
WHITE |
YELLOW |
Modifier and Type | Method and Description |
---|---|
static ColorEnum |
getByColor(Color color) |
static ColorEnum |
getByName(String name) |
Color |
getColor() |
String |
getName() |
Color |
getValue() |
static ColorEnum |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ColorEnum[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ColorEnum BLACK
public static final ColorEnum BLUE
public static final ColorEnum CYAN
public static final ColorEnum DARK_GRAY
public static final ColorEnum GRAY
public static final ColorEnum GREEN
public static final ColorEnum LIGHT_GRAY
public static final ColorEnum MAGENTA
public static final ColorEnum ORANGE
public static final ColorEnum PINK
public static final ColorEnum RED
public static final ColorEnum YELLOW
public static final ColorEnum WHITE
public static ColorEnum[] values()
for (ColorEnum c : ColorEnum.values()) System.out.println(c);
public static ColorEnum 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 final Color getColor()
public final Color getValue()
getValue
in interface NamedValueEnum<Color>
Copyright © 2017. All rights reserved.