Package com.fasterxml.jackson.annotation
Class JsonInclude.Value
- java.lang.Object
-
- com.fasterxml.jackson.annotation.JsonInclude.Value
-
- All Implemented Interfaces:
JacksonAnnotationValue<JsonInclude>,java.io.Serializable
- Enclosing class:
- JsonInclude
public static class JsonInclude.Value extends java.lang.Object implements JacksonAnnotationValue<JsonInclude>, java.io.Serializable
Helper class used to contain information from a singleJsonIncludeannotation.- Since:
- 2.6
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Value(JsonInclude src)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonInclude.Valueconstruct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl)Factory method to use for constructing an instance for componentsstatic JsonInclude.Valueconstruct(JsonInclude.Include valueIncl, JsonInclude.Include contentIncl, java.lang.Class<?> valueFilter, java.lang.Class<?> contentFilter)Factory method to use for constructing an instance for componentsstatic JsonInclude.Valueempty()booleanequals(java.lang.Object o)static JsonInclude.Valuefrom(JsonInclude src)Factory method to use for constructing an instance from instance ofJsonIncludejava.lang.Class<?>getContentFilter()JsonInclude.IncludegetContentInclusion()java.lang.Class<?>getValueFilter()JsonInclude.IncludegetValueInclusion()inthashCode()static JsonInclude.Valuemerge(JsonInclude.Value base, JsonInclude.Value overrides)Helper method that will try to combine values from twoJsonInclude.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 JsonInclude.ValuemergeAll(JsonInclude.Value... values)java.lang.StringtoString()java.lang.Class<JsonInclude>valueFor()Introspection method that may be used to find actual annotation that may be used as the source for value instance.JsonInclude.ValuewithContentFilter(java.lang.Class<?> filter)Mutant factory that will either SetcontentasUSE_DEFAULTSandcontentFiltertofilter(if filter not null); or SetcontentasALWAYS(if filter null)JsonInclude.ValuewithContentInclusion(JsonInclude.Include incl)JsonInclude.ValuewithOverrides(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.ValuewithValueFilter(java.lang.Class<?> filter)Mutant factory that will either SetvalueasUSE_DEFAULTSandvalueFiltertofilter(if filter not null); or SetvalueasALWAYS(if filter null)JsonInclude.ValuewithValueInclusion(JsonInclude.Include incl)
-
-
-
Constructor Detail
-
Value
public Value(JsonInclude src)
-
-
Method Detail
-
empty
public static JsonInclude.Value empty()
-
merge
public static JsonInclude.Value merge(JsonInclude.Value base, JsonInclude.Value overrides)
Helper method that will try to combine values from twoJsonInclude.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 JsonInclude.Value mergeAll(JsonInclude.Value... values)
- Since:
- 2.8
-
withOverrides
public 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. If no overrides exist will returnthisinstance; otherwise newJsonInclude.Valuewith 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, java.lang.Class<?> valueFilter, java.lang.Class<?> contentFilter)
Factory method to use for constructing an instance for components- Since:
- 2.9
-
from
public static JsonInclude.Value from(JsonInclude src)
Factory method to use for constructing an instance from instance ofJsonInclude
-
withValueInclusion
public JsonInclude.Value withValueInclusion(JsonInclude.Include incl)
-
withValueFilter
public JsonInclude.Value withValueFilter(java.lang.Class<?> filter)
Mutant factory that will either- Set
valueasUSE_DEFAULTSandvalueFiltertofilter(if filter not null); or - Set
valueasALWAYS(if filter null)
- Since:
- 2.9
- Set
-
withContentFilter
public JsonInclude.Value withContentFilter(java.lang.Class<?> filter)
Mutant factory that will either- Set
contentasUSE_DEFAULTSandcontentFiltertofilter(if filter not null); or - Set
contentasALWAYS(if filter null)
- Since:
- 2.9
- Set
-
withContentInclusion
public JsonInclude.Value withContentInclusion(JsonInclude.Include incl)
-
valueFor
public java.lang.Class<JsonInclude> 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<JsonInclude>- Returns:
- Annotation class for which instances of this value class are created
-
getValueInclusion
public JsonInclude.Include getValueInclusion()
-
getContentInclusion
public JsonInclude.Include getContentInclusion()
-
getValueFilter
public java.lang.Class<?> getValueFilter()
-
getContentFilter
public java.lang.Class<?> getContentFilter()
-
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
-
-