Package com.fasterxml.jackson.annotation
Class JsonInclude.Value
java.lang.Object
com.fasterxml.jackson.annotation.JsonInclude.Value
- All Implemented Interfaces:
JacksonAnnotationValue<JsonInclude>
,Serializable
- Enclosing class:
- JsonInclude
public static class JsonInclude.Value
extends Object
implements JacksonAnnotationValue<JsonInclude>, Serializable
Helper class used to contain information from a single
JsonInclude
annotation.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<?>
protected final JsonInclude.Include
protected final Class<?>
protected final JsonInclude.Include
protected static final JsonInclude.Value
-
Constructor Summary
ConstructorsModifierConstructorDescriptionValue
(JsonInclude src) protected
Value
(JsonInclude.Include vi, JsonInclude.Include ci, Class<?> valueFilter, Class<?> contentFilter) -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonInclude.Value
construct
(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl) Factory method to use for constructing an instance for componentsstatic JsonInclude.Value
construct
(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl, Class<?> valueFilter, Class<?> contentFilter) Factory method to use for constructing an instance for componentsstatic JsonInclude.Value
empty()
boolean
static JsonInclude.Value
from
(JsonInclude src) Factory method to use for constructing an instance from instance ofJsonInclude
Class<?>
Class<?>
int
hashCode()
static JsonInclude.Value
merge
(JsonInclude.Value base, JsonInclude.Value overrides) Helper method that will try to combine values from twoJsonInclude.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 JsonInclude.Value
mergeAll
(JsonInclude.Value... values) protected Object
toString()
valueFor()
Introspection method that may be used to find actual annotation that may be used as the source for value instance.withContentFilter
(Class<?> filter) Mutant factory that will either Setcontent
asUSE_DEFAULTS
andcontentFilter
tofilter
(if filter not null); or Setcontent
asALWAYS
(if filter null)withOverrides
(JsonInclude.Value overrides) Mutant factory method that merges values of this value with given override values, so that any explicitly defined inclusion in overrides has precedence over settings of this value instance.withValueFilter
(Class<?> filter) Mutant factory that will either Setvalue
asUSE_DEFAULTS
andvalueFilter
tofilter
(if filter not null); or Setvalue
asALWAYS
(if filter null)
-
Field Details
-
EMPTY
-
_valueInclusion
-
_contentInclusion
-
_valueFilter
-
_contentFilter
-
-
Constructor Details
-
Value
-
Value
protected Value(JsonInclude.Include vi, JsonInclude.Include ci, Class<?> valueFilter, Class<?> contentFilter)
-
-
Method Details
-
empty
-
merge
Helper method that will try to combine values from twoJsonInclude.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
-
readResolve
-
withOverrides
Mutant factory method that merges values of this value with given override values, so that any explicitly defined inclusion in overrides has precedence over settings of this value instance. If no overrides exist will returnthis
instance; otherwise newJsonInclude.Value
with changed inclusion values. -
construct
public static JsonInclude.Value construct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl) Factory method to use for constructing an instance for components -
construct
public static JsonInclude.Value construct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl, Class<?> valueFilter, Class<?> contentFilter) Factory method to use for constructing an instance for components -
from
Factory method to use for constructing an instance from instance ofJsonInclude
-
withValueInclusion
-
withValueFilter
Mutant factory that will either- Set
value
asUSE_DEFAULTS
andvalueFilter
tofilter
(if filter not null); or - Set
value
asALWAYS
(if filter null)
- Set
-
withContentFilter
Mutant factory that will either- Set
content
asUSE_DEFAULTS
andcontentFilter
tofilter
(if filter not null); or - Set
content
asALWAYS
(if filter null)
- Set
-
withContentInclusion
-
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<JsonInclude>
- Returns:
- Annotation class for which instances of this value class are created
-
getValueInclusion
-
getContentInclusion
-
getValueFilter
-
getContentFilter
-
toString
-
hashCode
public int hashCode() -
equals
-