|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<OptBoolean> com.fasterxml.jackson.annotation.OptBoolean
public enum OptBoolean
Optional Boolean value ("nullean"). Needed just because Java annotations
can not take 'null' as a value (even as default), so there is no
way to distinguish between explicit `true` and `false`, and lack of
choice (related: annotations are limited to primitives, so
Boolean
not allowed as solution).
Note: although use of `true` and `false` would be more convenient, they can not be chosen since they are Java keyword and compiler won't allow the choice. And since enum naming convention suggests all-upper-case, that is what is done here.
Enum Constant Summary | |
---|---|
DEFAULT
Value that indicates that the annotation property does NOT have an explicit definition of enabled/disabled (or true/false); instead, a higher-level configuration value is used; or lacking higher-level global setting, default. |
|
FALSE
Value that indicates that the annotation property is explicitly defined to be disabled, or false. |
|
TRUE
Value that indicates that the annotation property is explicitly defined to be enabled, or true. |
Method Summary | |
---|---|
Boolean |
asBoolean()
|
boolean |
asPrimitive()
|
static OptBoolean |
fromBoolean(Boolean b)
|
static OptBoolean |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static OptBoolean[] |
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 class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final OptBoolean TRUE
public static final OptBoolean FALSE
public static final OptBoolean DEFAULT
Method Detail |
---|
public static OptBoolean[] values()
for (OptBoolean c : OptBoolean.values()) System.out.println(c);
public static OptBoolean valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic Boolean asBoolean()
public boolean asPrimitive()
public static OptBoolean fromBoolean(Boolean b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |