Package com.fasterxml.jackson.annotation
Class JsonFormat.Value
java.lang.Object
com.fasterxml.jackson.annotation.JsonFormat.Value
- All Implemented Interfaces:
JacksonAnnotationValue<JsonFormat>
,Serializable
- Enclosing class:
- JsonFormat
public static class JsonFormat.Value
extends Object
implements JacksonAnnotationValue<JsonFormat>, Serializable
Helper class used to contain information from a single
JsonFormat
annotation.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionValue()
Value
(JsonFormat ann) Value
(String p, JsonFormat.Shape sh, String localeStr, String tzStr, JsonFormat.Features f, Boolean lenient) Value
(String p, JsonFormat.Shape sh, Locale l, String tzStr, TimeZone tz, JsonFormat.Features f, Boolean lenient) Value
(String p, JsonFormat.Shape sh, Locale l, TimeZone tz, JsonFormat.Features f, Boolean lenient) -
Method Summary
Modifier and TypeMethodDescriptionstatic final JsonFormat.Value
empty()
boolean
static JsonFormat.Value
forLeniency
(boolean lenient) static JsonFormat.Value
forPattern
(String p) static JsonFormat.Value
static final JsonFormat.Value
from
(JsonFormat ann) Accessor for checking whether this format value has specific setting for given feature.Accessor for getting full set of features enabled/disabled.getShape()
int
hashCode()
boolean
Accessor for checking whether there is a setting for leniency.boolean
boolean
boolean
hasShape()
boolean
boolean
Convenience method equivalent tostatic JsonFormat.Value
merge
(JsonFormat.Value base, JsonFormat.Value overrides) Helper method that will try to combine values from twoJsonFormat.Value
instances, using one as base settings, and the other as overrides to use instead of base values when defined; base values are only use if override does not specify a value (matching value is null or logically missing).static JsonFormat.Value
mergeAll
(JsonFormat.Value... values) Alternate access (compared togetTimeZone()
) which is useful when caller just wants time zone id to convert, but not as JDK providedTimeZone
toString()
valueFor()
Introspection method that may be used to find actual annotation that may be used as the source for value instance.withLenient
(Boolean lenient) withLocale
(Locale l) final JsonFormat.Value
withOverrides
(JsonFormat.Value overrides) withTimeZone
(TimeZone tz)
-
Constructor Details
-
Value
public Value() -
Value
-
Value
public Value(String p, JsonFormat.Shape sh, String localeStr, String tzStr, JsonFormat.Features f, Boolean lenient) -
Value
public Value(String p, JsonFormat.Shape sh, Locale l, TimeZone tz, JsonFormat.Features f, Boolean lenient) -
Value
public Value(String p, JsonFormat.Shape sh, Locale l, String tzStr, TimeZone tz, JsonFormat.Features f, Boolean lenient)
-
-
Method Details
-
empty
-
merge
Helper method that will try to combine values from twoJsonFormat.Value
instances, using one as base settings, and the other as overrides to use instead of base values when defined; base values are only use if override does not specify a value (matching value is null or logically missing). Note that one or both of value instances may be `null`, directly; if both are `null`, result will also be `null`; otherwise never null. -
mergeAll
-
from
-
withOverrides
-
forPattern
-
forShape
-
forLeniency
-
withPattern
-
withShape
-
withLocale
-
withTimeZone
-
withLenient
-
withFeature
-
withoutFeature
-
valueFor
Description copied from interface:JacksonAnnotationValue
Introspection method that may be used to find actual annotation that may be used as the source for value instance.- Specified by:
valueFor
in interfaceJacksonAnnotationValue<JsonFormat>
- Returns:
- Annotation class for which instances of this value class are created
-
getPattern
-
getShape
-
getLocale
-
getLenient
- Returns:
Boolean.TRUE
if explicitly set to true;Boolean.FALSE
if explicit set to false; ornull
if not set either way (assuming "default leniency" for the context)
-
isLenient
public boolean isLenient()Convenience method equivalent toBoolean.TRUE.equals(getLenient())
that is, returnstrue
if (and only if) leniency has been explicitly set to {code true}; but not if it is undefined. -
timeZoneAsString
Alternate access (compared togetTimeZone()
) which is useful when caller just wants time zone id to convert, but not as JDK providedTimeZone
-
getTimeZone
-
hasShape
public boolean hasShape() -
hasPattern
public boolean hasPattern() -
hasLocale
public boolean hasLocale() -
hasTimeZone
public boolean hasTimeZone() -
hasLenient
public boolean hasLenient()Accessor for checking whether there is a setting for leniency. NOTE: does NOT mean that `lenient` is `true` necessarily; just that it has been set. -
getFeature
Accessor for checking whether this format value has specific setting for given feature. Result is 3-valued with either `null`,Boolean.TRUE
orBoolean.FALSE
, indicating 'yes/no/dunno' choices, where `null` ("dunno") indicates that the default handling should be used based on global defaults, and there is no format override. -
getFeatures
Accessor for getting full set of features enabled/disabled. -
toString
-
hashCode
public int hashCode() -
equals
-