Package com.fasterxml.jackson.annotation
Enum Class OptBoolean
- All Implemented Interfaces:
Serializable
,Comparable<OptBoolean>
,Constable
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 the 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionValue 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.Value that indicates that the annotation property is explicitly defined to be disabled, or false.Value that indicates that the annotation property is explicitly defined to be enabled, or true. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
static OptBoolean
static OptBoolean
Returns the enum constant of this class with the specified name.static OptBoolean[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TRUE
Value that indicates that the annotation property is explicitly defined to be enabled, or true. -
FALSE
Value that indicates that the annotation property is explicitly defined to be disabled, or false. -
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.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
asBoolean
-
asPrimitive
public boolean asPrimitive() -
fromBoolean
-
equals
-