Package com.fasterxml.jackson.annotation
Class JsonFormat.Value
- java.lang.Object
-
- com.fasterxml.jackson.annotation.JsonFormat.Value
-
- All Implemented Interfaces:
JacksonAnnotationValue<JsonFormat>,java.io.Serializable
- Enclosing class:
- JsonFormat
public static class JsonFormat.Value extends java.lang.Object implements JacksonAnnotationValue<JsonFormat>, java.io.Serializable
Helper class used to contain information from a singleJsonFormatannotation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Value()Value(JsonFormat ann)Value(java.lang.String p, JsonFormat.Shape sh, java.lang.String localeStr, java.lang.String tzStr, JsonFormat.Features f)Deprecated.Value(java.lang.String p, JsonFormat.Shape sh, java.lang.String localeStr, java.lang.String tzStr, JsonFormat.Features f, java.lang.Boolean lenient)Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.lang.String tzStr, java.util.TimeZone tz, JsonFormat.Features f)Deprecated.Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.lang.String tzStr, java.util.TimeZone tz, JsonFormat.Features f, java.lang.Boolean lenient)Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.util.TimeZone tz, JsonFormat.Features f)Deprecated.Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.util.TimeZone tz, JsonFormat.Features f, java.lang.Boolean lenient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonFormat.Valueempty()booleanequals(java.lang.Object o)static JsonFormat.ValueforLeniency(boolean lenient)static JsonFormat.ValueforPattern(java.lang.String p)static JsonFormat.ValueforShape(JsonFormat.Shape sh)static JsonFormat.Valuefrom(JsonFormat ann)java.lang.BooleangetFeature(JsonFormat.Feature f)Accessor for checking whether this format value has specific setting for given feature.JsonFormat.FeaturesgetFeatures()Accessor for getting full set of features enabled/disabled.java.lang.BooleangetLenient()java.util.LocalegetLocale()java.lang.StringgetPattern()JsonFormat.ShapegetShape()java.util.TimeZonegetTimeZone()inthashCode()booleanhasLenient()Accessor for checking whether there is a setting for leniency.booleanhasLocale()booleanhasPattern()booleanhasShape()booleanhasTimeZone()booleanisLenient()Convenience method equivalent tostatic JsonFormat.Valuemerge(JsonFormat.Value base, JsonFormat.Value overrides)Helper method that will try to combine values from twoJsonFormat.Valueinstances, 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.ValuemergeAll(JsonFormat.Value... values)java.lang.StringtimeZoneAsString()Alternate access (compared togetTimeZone()) which is useful when caller just wants time zone id to convert, but not as JDK providedTimeZonejava.lang.StringtoString()java.lang.Class<JsonFormat>valueFor()Introspection method that may be used to find actual annotation that may be used as the source for value instance.JsonFormat.ValuewithFeature(JsonFormat.Feature f)JsonFormat.ValuewithLenient(java.lang.Boolean lenient)JsonFormat.ValuewithLocale(java.util.Locale l)JsonFormat.ValuewithoutFeature(JsonFormat.Feature f)JsonFormat.ValuewithOverrides(JsonFormat.Value overrides)JsonFormat.ValuewithPattern(java.lang.String p)JsonFormat.ValuewithShape(JsonFormat.Shape s)JsonFormat.ValuewithTimeZone(java.util.TimeZone tz)
-
-
-
Constructor Detail
-
Value
public Value()
-
Value
public Value(JsonFormat ann)
-
Value
public Value(java.lang.String p, JsonFormat.Shape sh, java.lang.String localeStr, java.lang.String tzStr, JsonFormat.Features f, java.lang.Boolean lenient)- Since:
- 2.9
-
Value
public Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.util.TimeZone tz, JsonFormat.Features f, java.lang.Boolean lenient)- Since:
- 2.9
-
Value
public Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.lang.String tzStr, java.util.TimeZone tz, JsonFormat.Features f, java.lang.Boolean lenient)- Since:
- 2.9
-
Value
@Deprecated public Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.lang.String tzStr, java.util.TimeZone tz, JsonFormat.Features f)Deprecated.
-
Value
@Deprecated public Value(java.lang.String p, JsonFormat.Shape sh, java.lang.String localeStr, java.lang.String tzStr, JsonFormat.Features f)Deprecated.
-
Value
@Deprecated public Value(java.lang.String p, JsonFormat.Shape sh, java.util.Locale l, java.util.TimeZone tz, JsonFormat.Features f)Deprecated.
-
-
Method Detail
-
empty
public static final JsonFormat.Value empty()
- Since:
- 2.7
-
merge
public static JsonFormat.Value merge(JsonFormat.Value base, JsonFormat.Value overrides)
Helper method that will try to combine values from twoJsonFormat.Valueinstances, 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.- Since:
- 2.8
-
mergeAll
public static JsonFormat.Value mergeAll(JsonFormat.Value... values)
- Since:
- 2.8
-
from
public static final JsonFormat.Value from(JsonFormat ann)
- Since:
- 2.7
-
withOverrides
public final JsonFormat.Value withOverrides(JsonFormat.Value overrides)
- Since:
- 2.7
-
forPattern
public static JsonFormat.Value forPattern(java.lang.String p)
- Since:
- 2.6
-
forShape
public static JsonFormat.Value forShape(JsonFormat.Shape sh)
- Since:
- 2.7
-
forLeniency
public static JsonFormat.Value forLeniency(boolean lenient)
- Since:
- 2.9
-
withPattern
public JsonFormat.Value withPattern(java.lang.String p)
- Since:
- 2.1
-
withShape
public JsonFormat.Value withShape(JsonFormat.Shape s)
- Since:
- 2.1
-
withLocale
public JsonFormat.Value withLocale(java.util.Locale l)
- Since:
- 2.1
-
withTimeZone
public JsonFormat.Value withTimeZone(java.util.TimeZone tz)
- Since:
- 2.1
-
withLenient
public JsonFormat.Value withLenient(java.lang.Boolean lenient)
- Since:
- 2.9
-
withFeature
public JsonFormat.Value withFeature(JsonFormat.Feature f)
- Since:
- 2.6
-
withoutFeature
public JsonFormat.Value withoutFeature(JsonFormat.Feature f)
- Since:
- 2.6
-
valueFor
public java.lang.Class<JsonFormat> valueFor()
Description copied from interface:JacksonAnnotationValueIntrospection method that may be used to find actual annotation that may be used as the source for value instance.- Specified by:
valueForin interfaceJacksonAnnotationValue<JsonFormat>- Returns:
- Annotation class for which instances of this value class are created
-
getPattern
public java.lang.String getPattern()
-
getShape
public JsonFormat.Shape getShape()
-
getLocale
public java.util.Locale getLocale()
-
getLenient
public java.lang.Boolean getLenient()
- Returns:
Boolean.TRUEif explicitly set to true;Boolean.FALSEif explicit set to false; ornullif not set either way (assuming "default leniency" for the context)- Since:
- 2.9
-
isLenient
public boolean isLenient()
Convenience method equivalent toBoolean.TRUE.equals(getLenient())
that is, returnstrueif (and only if) leniency has been explicitly set to {code true}; but not if it is undefined.- Since:
- 2.9
-
timeZoneAsString
public java.lang.String timeZoneAsString()
Alternate access (compared togetTimeZone()) which is useful when caller just wants time zone id to convert, but not as JDK providedTimeZone- Since:
- 2.4
-
getTimeZone
public java.util.TimeZone getTimeZone()
-
hasShape
public boolean hasShape()
- Since:
- 2.4
-
hasPattern
public boolean hasPattern()
- Since:
- 2.4
-
hasLocale
public boolean hasLocale()
- Since:
- 2.4
-
hasTimeZone
public boolean hasTimeZone()
- Since:
- 2.4
-
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.- Since:
- 2.9
-
getFeature
public java.lang.Boolean getFeature(JsonFormat.Feature f)
Accessor for checking whether this format value has specific setting for given feature. Result is 3-valued with either `null`,Boolean.TRUEorBoolean.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.- Since:
- 2.6
-
getFeatures
public JsonFormat.Features getFeatures()
Accessor for getting full set of features enabled/disabled.- Since:
- 2.8
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-