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.
Since:
2.6
See Also:
  • Constructor Details

  • Method Details

    • 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 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). 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 return this instance; otherwise new JsonInclude.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
      Since:
      2.9
    • from

      public static JsonInclude.Value from(JsonInclude src)
      Factory method to use for constructing an instance from instance of JsonInclude
    • withValueInclusion

      public JsonInclude.Value withValueInclusion(JsonInclude.Include incl)
    • withValueFilter

      public 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)
      Since:
      2.9
    • withContentFilter

      public 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)
      Since:
      2.9
    • withContentInclusion

      public JsonInclude.Value withContentInclusion(JsonInclude.Include incl)
    • valueFor

      public Class<JsonInclude> 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 interface JacksonAnnotationValue<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 Class<?> getValueFilter()
    • getContentFilter

      public Class<?> getContentFilter()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object