lombok
Enum Singleton.Style
java.lang.Object
java.lang.Enum<Singleton.Style>
lombok.Singleton.Style
- All Implemented Interfaces:
- Serializable, Comparable<Singleton.Style>
- Enclosing class:
- Singleton
public static enum Singleton.Style
- extends Enum<Singleton.Style>
|
Enum Constant Summary |
ENUM
enum SingletonEnumExample {
INSTANCE;
public static SingletonEnumExample getInstance() {
return INSTANCE;
}
}
|
HOLDER
class SingletonHolderExample {
private static class SingletonHolderExampleHolder {
private static final SingletonHolderExample INSTANCE = new SingletonHolderExample();
}
public static SingletonHolderExample getInstance() {
return SingletonHolderExampleHolder.INSTANCE;
}
}
|
|
Method Summary |
static Singleton.Style |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Singleton.Style[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
ENUM
public static final Singleton.Style ENUM
enum SingletonEnumExample {
INSTANCE;
public static SingletonEnumExample getInstance() {
return INSTANCE;
}
}
HOLDER
public static final Singleton.Style HOLDER
class SingletonHolderExample {
private static class SingletonHolderExampleHolder {
private static final SingletonHolderExample INSTANCE = new SingletonHolderExample();
}
public static SingletonHolderExample getInstance() {
return SingletonHolderExampleHolder.INSTANCE;
}
}
values
public static Singleton.Style[] 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 (Singleton.Style c : Singleton.Style.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static Singleton.Style 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 name
NullPointerException - if the argument is null
Copyright © 2010-2011 Philipp Eichhorn, licensed under the MIT licence.