public static class JsonInclude.Value extends Object implements JacksonAnnotationValue<JsonInclude>, Serializable
JsonInclude
annotation.| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
_contentFilter |
protected JsonInclude.Include |
_contentInclusion |
protected Class<?> |
_valueFilter |
protected JsonInclude.Include |
_valueInclusion |
static JsonInclude.Value |
ALL_ALWAYS
Constant that indicates that property is to be always included,
independent of value of the property.
|
static JsonInclude.Value |
ALL_NON_ABSENT
Constant that indicates that properties are included unless their value
is:
null
"absent" value of a referential type (like Java 8 `Optional`, or
AtomicReference); that is, something
that would not deference to a non-null value. |
static JsonInclude.Value |
ALL_NON_DEFAULT
The equivalent to
JsonInclude.Include.NON_DEFAULT for specifying
inclusion of non-defaults for both values and content. |
static JsonInclude.Value |
ALL_NON_EMPTY
Constant that indicates that only properties with null value,
or what is considered empty, are not to be included.
|
static JsonInclude.Value |
ALL_NON_NULL
Constant that indicates that only properties with non-null
values are to be included.
|
protected static JsonInclude.Value |
EMPTY |
| Modifier | Constructor and Description |
|---|---|
protected |
Value(JsonInclude.Include vi,
JsonInclude.Include ci,
Class<?> valueFilter,
Class<?> contentFilter) |
|
Value(JsonInclude src) |
| Modifier and Type | Method and Description |
|---|---|
static JsonInclude.Value |
construct(JsonInclude.Include valueIncl,
JsonInclude.Include contentIncl)
Factory method to use for constructing an instance for components
|
static JsonInclude.Value |
construct(JsonInclude.Include valueIncl,
JsonInclude.Include contentIncl,
Class<?> valueFilter,
Class<?> contentFilter)
Factory method to use for constructing an instance for components
|
static JsonInclude.Value |
empty() |
boolean |
equals(Object o) |
static JsonInclude.Value |
from(JsonInclude src)
Factory method to use for constructing an instance from instance of
JsonInclude |
Class<?> |
getContentFilter() |
JsonInclude.Include |
getContentInclusion() |
Class<?> |
getValueFilter() |
JsonInclude.Include |
getValueInclusion() |
int |
hashCode() |
static JsonInclude.Value |
merge(JsonInclude.Value base,
JsonInclude.Value overrides)
Helper method that will try to combine values from two
JsonInclude.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 |
readResolve() |
String |
toString() |
Class<JsonInclude> |
valueFor()
Introspection method that may be used to find actual annotation that may be used
as the source for value instance.
|
JsonInclude.Value |
withContentFilter(Class<?> filter)
Mutant factory that will either
Set
content as USE_DEFAULTS
and contentFilter to filter (if filter not null);
or
Set content as ALWAYS (if filter null)
|
JsonInclude.Value |
withContentInclusion(JsonInclude.Include incl) |
JsonInclude.Value |
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.
|
JsonInclude.Value |
withValueFilter(Class<?> filter)
Mutant factory that will either
Set
value as USE_DEFAULTS
and valueFilter to filter (if filter not null);
or
Set value as ALWAYS (if filter null)
|
JsonInclude.Value |
withValueInclusion(JsonInclude.Include incl) |
public static final JsonInclude.Value ALL_ALWAYS
This will specify the same setting for including a value both
on Java object level as well as when contained
in an object reference (see JsonInclude for further
details on this distinction).
public static final JsonInclude.Value ALL_NON_NULL
This will specify the same setting for including a value both
on Java object level as well as when contained
in an object reference (see JsonInclude for further
details on this distinction).
public static final JsonInclude.Value ALL_NON_ABSENT
AtomicReference); that is, something
that would not deference to a non-null value.
This will specify the same setting for including a value both
on Java object level as well as when contained
in an object reference (see JsonInclude for further
details on this distinction).
public static final JsonInclude.Value ALL_NON_EMPTY
JsonInclude.Include.NON_EMPTY for further details.
This will specify the same setting for including a value both
on Java object level as well as when contained
in an object reference (see JsonInclude for further
details on this distinction).
public static final JsonInclude.Value ALL_NON_DEFAULT
JsonInclude.Include.NON_DEFAULT for specifying
inclusion of non-defaults for both values and content.
This will specify the same setting for including a value both
on Java object level as well as when contained
in an object reference (see JsonInclude for further
details on this distinction).
protected static final JsonInclude.Value EMPTY
protected final JsonInclude.Include _valueInclusion
protected final JsonInclude.Include _contentInclusion
protected final Class<?> _valueFilter
protected final Class<?> _contentFilter
public Value(JsonInclude src)
protected Value(JsonInclude.Include vi, JsonInclude.Include ci, Class<?> valueFilter, Class<?> contentFilter)
public static JsonInclude.Value empty()
public static JsonInclude.Value merge(JsonInclude.Value base, JsonInclude.Value overrides)
JsonInclude.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.public static JsonInclude.Value mergeAll(JsonInclude.Value... values)
protected Object readResolve()
public JsonInclude.Value withOverrides(JsonInclude.Value overrides)
this
instance; otherwise new JsonInclude.Value with changed inclusion values.public static JsonInclude.Value construct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl)
public static JsonInclude.Value construct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl, Class<?> valueFilter, Class<?> contentFilter)
public static JsonInclude.Value from(JsonInclude src)
JsonIncludepublic JsonInclude.Value withValueInclusion(JsonInclude.Include incl)
public JsonInclude.Value withValueFilter(Class<?> filter)
value as USE_DEFAULTS
and valueFilter to filter (if filter not null);
orvalue as ALWAYS (if filter null)
public JsonInclude.Value withContentFilter(Class<?> filter)
content as USE_DEFAULTS
and contentFilter to filter (if filter not null);
orcontent as ALWAYS (if filter null)
public JsonInclude.Value withContentInclusion(JsonInclude.Include incl)
public Class<JsonInclude> valueFor()
JacksonAnnotationValuevalueFor in interface JacksonAnnotationValue<JsonInclude>public JsonInclude.Include getValueInclusion()
public JsonInclude.Include getContentInclusion()
public Class<?> getValueFilter()
public Class<?> getContentFilter()
Copyright © 2008–2026 FasterXML. All rights reserved.