JsonIgnoreProperties.Value (Jackson-annotations 2.9.0 API)
Date: 2018-01-23

com.fasterxml.jackson.annotation

## Class JsonIgnoreProperties.Value

- java.lang.Object
- - com.fasterxml.jackson.annotation.JsonIgnoreProperties.Value

- All Implemented Interfaces:
    JacksonAnnotationValue<JsonIgnoreProperties>, Serializable
  Enclosing class:
    JsonIgnoreProperties

      public static class JsonIgnoreProperties.Value
      extends Object
      implements JacksonAnnotationValue<JsonIgnoreProperties>, Serializable

  Helper class used to contain information from a single `JsonIgnoreProperties` annotation, as well as to provide possible overrides from non-annotation sources.
  Since:
    2.8
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `_allowGetters`
    `protected boolean` | `_allowSetters`
    `protected Set<String>` | `_ignored` Names of properties to ignore.
    `protected boolean` | `_ignoreUnknown`
    `protected boolean` | `_merge`
    `protected static JsonIgnoreProperties.Value` | `EMPTY` Default instance has no explicitly ignored fields, does not ignore unknowns, does not explicitly allow getters/setters (that is, ignorals apply to both), but does use merging for combining overrides with base settings

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JsonIgnoreProperties.Value(Set<String> ignored, boolean ignoreUnknown, boolean allowGetters, boolean allowSetters, boolean merge)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JsonIgnoreProperties.Value` | `construct(Set<String> ignored, boolean ignoreUnknown, boolean allowGetters, boolean allowSetters, boolean merge)` Factory method that may be used (although is NOT the recommended way) to construct an instance from a full set of properties.
    `static JsonIgnoreProperties.Value` | `empty()` Accessor for default instances which has "empty" settings; that is: No explicitly defined fields to ignore Does not ignore unknown fields Does not "allow" getters if property ignored (that is, ignorals apply to both setter and getter) Does not "allow" setters if property ignored (that is, ignorals apply to both setter and getter) Does use merge when combining overrides to base settings, such that `true` settings for any of the properties results in `true`, and names of fields are combined (union)
    `boolean` | `equals(Object o)`
    `Set<String>` | `findIgnoredForDeserialization()` Method called to find names of properties to ignore when used for serialization: functionally same as `getIgnored()` if `getAllowSetters()` is false (that is, there is "allowSetters=false" or equivalent), otherwise returns empty `Set`.
    `Set<String>` | `findIgnoredForSerialization()` Method called to find names of properties to ignore when used for serialization: functionally same as `getIgnored()` if `getAllowGetters()` is false (that is, there is "allowGetters=false" or equivalent), otherwise returns empty `Set`.
    `static JsonIgnoreProperties.Value` | `forIgnoredProperties(Set<String> propNames)`
    `static JsonIgnoreProperties.Value` | `forIgnoredProperties(String... propNames)`
    `static JsonIgnoreProperties.Value` | `forIgnoreUnknown(boolean state)`
    `static JsonIgnoreProperties.Value` | `from(JsonIgnoreProperties src)`
    `boolean` | `getAllowGetters()`
    `boolean` | `getAllowSetters()`
    `Set<String>` | `getIgnored()`
    `boolean` | `getIgnoreUnknown()`
    `boolean` | `getMerge()`
    `int` | `hashCode()`
    `static JsonIgnoreProperties.Value` | `merge(JsonIgnoreProperties.Value base, JsonIgnoreProperties.Value overrides)` Helper method that will try to combine values from two `JsonIgnoreProperties.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 JsonIgnoreProperties.Value` | `mergeAll(JsonIgnoreProperties.Value... values)`
    `protected Object` | `readResolve()`
    `String` | `toString()`
    `Class<JsonIgnoreProperties>` | `valueFor()` Introspection method that may be used to find actual annotation that may be used as the source for value instance.
    `JsonIgnoreProperties.Value` | `withAllowGetters()`
    `JsonIgnoreProperties.Value` | `withAllowSetters()`
    `JsonIgnoreProperties.Value` | `withIgnored(Set<String> ignored)`
    `JsonIgnoreProperties.Value` | `withIgnored(String... ignored)`
    `JsonIgnoreProperties.Value` | `withIgnoreUnknown()`
    `JsonIgnoreProperties.Value` | `withMerge()`
    `JsonIgnoreProperties.Value` | `withoutAllowGetters()`
    `JsonIgnoreProperties.Value` | `withoutAllowSetters()`
    `JsonIgnoreProperties.Value` | `withoutIgnored()`
    `JsonIgnoreProperties.Value` | `withoutIgnoreUnknown()`
    `JsonIgnoreProperties.Value` | `withoutMerge()`
    `JsonIgnoreProperties.Value` | `withOverrides(JsonIgnoreProperties.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.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          protected static final JsonIgnoreProperties.Value EMPTY

      Default instance has no explicitly ignored fields, does not ignore unknowns, does not explicitly allow getters/setters (that is, ignorals apply to both), but does use merging for combining overrides with base settings

    - #### _ignored

          protected final Set<String> _ignored

      Names of properties to ignore.

    - #### _ignoreUnknown

          protected final boolean _ignoreUnknown

    - #### _allowGetters

          protected final boolean _allowGetters

    - #### _allowSetters

          protected final boolean _allowSetters

    - #### _merge

          protected final boolean _merge

  - ### Constructor Detail

    - #### JsonIgnoreProperties.Value

          protected JsonIgnoreProperties.Value(Set<String> ignored,
                                    boolean ignoreUnknown,
                                    boolean allowGetters,
                                    boolean allowSetters,
                                    boolean merge)

  - ### Method Detail

    - #### from

          public static JsonIgnoreProperties.Value from(JsonIgnoreProperties src)

    - #### construct

          public static JsonIgnoreProperties.Value construct(Set<String> ignored,
                                             boolean ignoreUnknown,
                                             boolean allowGetters,
                                             boolean allowSetters,
                                             boolean merge)

      Factory method that may be used (although is NOT the recommended way) to construct an instance from a full set of properties. Most users would be better of starting by `empty()` instance and using `withXxx()`/`withoutXxx()` methods, as this factory method may need to be changed if new properties are added in `JsonIgnoreProperties` annotation.

    - #### empty

          public static JsonIgnoreProperties.Value empty()

      Accessor for default instances which has "empty" settings; that is:
      - No explicitly defined fields to ignore
      - Does not ignore unknown fields
      - Does not "allow" getters if property ignored (that is, ignorals apply to both setter and getter)
      - Does not "allow" setters if property ignored (that is, ignorals apply to both setter and getter)
      - Does use merge when combining overrides to base settings, such that `true` settings for any of the properties results in `true`, and names of fields are combined (union)

    - #### merge

          public static JsonIgnoreProperties.Value merge(JsonIgnoreProperties.Value base,
                                         JsonIgnoreProperties.Value overrides)

      Helper method that will try to combine values from two `JsonIgnoreProperties.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

          public static JsonIgnoreProperties.Value mergeAll(JsonIgnoreProperties.Value... values)

      Since:
        2.8

    - #### forIgnoredProperties

          public static JsonIgnoreProperties.Value forIgnoredProperties(Set<String> propNames)

    - #### forIgnoredProperties

          public static JsonIgnoreProperties.Value forIgnoredProperties(String... propNames)

    - #### forIgnoreUnknown

          public static JsonIgnoreProperties.Value forIgnoreUnknown(boolean state)

    - #### withOverrides

          public JsonIgnoreProperties.Value withOverrides(JsonIgnoreProperties.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 `JsonIgnoreProperties.Value` with changed inclusion values.

    - #### withIgnored

          public JsonIgnoreProperties.Value withIgnored(Set<String> ignored)

    - #### withIgnored

          public JsonIgnoreProperties.Value withIgnored(String... ignored)

    - #### withoutIgnored

          public JsonIgnoreProperties.Value withoutIgnored()

    - #### withIgnoreUnknown

          public JsonIgnoreProperties.Value withIgnoreUnknown()

    - #### withoutIgnoreUnknown

          public JsonIgnoreProperties.Value withoutIgnoreUnknown()

    - #### withAllowGetters

          public JsonIgnoreProperties.Value withAllowGetters()

    - #### withoutAllowGetters

          public JsonIgnoreProperties.Value withoutAllowGetters()

    - #### withAllowSetters

          public JsonIgnoreProperties.Value withAllowSetters()

    - #### withoutAllowSetters

          public JsonIgnoreProperties.Value withoutAllowSetters()

    - #### withMerge

          public JsonIgnoreProperties.Value withMerge()

    - #### withoutMerge

          public JsonIgnoreProperties.Value withoutMerge()

    - #### valueFor

          public Class<JsonIgnoreProperties> 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<JsonIgnoreProperties>`

    - #### readResolve

          protected Object readResolve()

    - #### getIgnored

          public Set<String> getIgnored()

    - #### findIgnoredForSerialization

          public Set<String> findIgnoredForSerialization()

      Method called to find names of properties to ignore when used for serialization: functionally same as `getIgnored()` if `getAllowGetters()` is false (that is, there is "allowGetters=false" or equivalent), otherwise returns empty `Set`.

    - #### findIgnoredForDeserialization

          public Set<String> findIgnoredForDeserialization()

      Method called to find names of properties to ignore when used for serialization: functionally same as `getIgnored()` if `getAllowSetters()` is false (that is, there is "allowSetters=false" or equivalent), otherwise returns empty `Set`.

    - #### getIgnoreUnknown

          public boolean getIgnoreUnknown()

    - #### getAllowGetters

          public boolean getAllowGetters()

    - #### getAllowSetters

          public boolean getAllowSetters()

    - #### getMerge

          public boolean getMerge()

    - #### 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`

Copyright © 2008–2018 FasterXML. All rights reserved.