PropertyMetadata
Date: 2016-12-04

com.fasterxml.jackson.databind

## Class PropertyMetadata

- java.lang.Object
- - com.fasterxml.jackson.databind.PropertyMetadata

- All Implemented Interfaces:
    java.io.Serializable

      public class PropertyMetadata
      extends java.lang.Object
      implements java.io.Serializable

  Simple container class used for storing "additional" metadata about properties. Carved out to reduce number of distinct properties that actual property implementations and placeholders need to store; since instances are immutable, they can be freely shared.
  Since:
    2.3
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `_defaultValue` Optional default value, as String, for property; not used cor any functionality by core databind, offered as metadata for extensions.
    `protected java.lang.String` | `_description` Optional human-readable description associated with the property.
    `protected java.lang.Integer` | `_index` Optional index of the property within containing Object.
    `protected java.lang.Boolean` | `_required` Three states: required, not required and unknown; unknown represented as null.
    `static PropertyMetadata` | `STD_OPTIONAL`
    `static PropertyMetadata` | `STD_REQUIRED`
    `static PropertyMetadata` | `STD_REQUIRED_OR_OPTIONAL`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PropertyMetadata(java.lang.Boolean req, java.lang.String desc)` Deprecated.
    `protected` | `PropertyMetadata(java.lang.Boolean req, java.lang.String desc, java.lang.Integer index, java.lang.String def)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PropertyMetadata` | `construct(boolean req, java.lang.String desc)` Deprecated.
    `static PropertyMetadata` | `construct(boolean req, java.lang.String desc, java.lang.Integer index, java.lang.String defaultValue)`
    `java.lang.String` | `getDefaultValue()`
    `java.lang.String` | `getDescription()`
    `java.lang.Integer` | `getIndex()`
    `java.lang.Boolean` | `getRequired()`
    `boolean` | `hasDefaultValue()` Accessor for determining whether property has declared "default value", which may be used by extension modules.
    `boolean` | `hasDefuaultValue()` Deprecated. Since 2.6: typo in name, use `hasDefaultValue()` instead.
    `boolean` | `hasIndex()`
    `boolean` | `isRequired()`
    `protected java.lang.Object` | `readResolve()` Minor optimization: let's canonicalize back to placeholders in cases where there is no real data to consider
    `PropertyMetadata` | `withDefaultValue(java.lang.String def)`
    `PropertyMetadata` | `withDescription(java.lang.String desc)`
    `PropertyMetadata` | `withIndex(java.lang.Integer index)`
    `PropertyMetadata` | `withRequired(java.lang.Boolean b)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### STD_REQUIRED

          public static final PropertyMetadata STD_REQUIRED

    - #### STD_OPTIONAL

          public static final PropertyMetadata STD_OPTIONAL

    - #### STD_REQUIRED_OR_OPTIONAL

          public static final PropertyMetadata STD_REQUIRED_OR_OPTIONAL

    - #### _required

          protected final java.lang.Boolean _required

      Three states: required, not required and unknown; unknown represented as null.

    - #### _description

          protected final java.lang.String _description

      Optional human-readable description associated with the property.

    - #### _index

          protected final java.lang.Integer _index

      Optional index of the property within containing Object.
      Since:
        2.4

    - #### _defaultValue

          protected final java.lang.String _defaultValue

      Optional default value, as String, for property; not used cor any functionality by core databind, offered as metadata for extensions.

  - ### Constructor Detail

    - #### PropertyMetadata

          @Deprecated
          protected PropertyMetadata(java.lang.Boolean req,
                                     java.lang.String desc)

      Deprecated.

    - #### PropertyMetadata

          protected PropertyMetadata(java.lang.Boolean req,
                          java.lang.String desc,
                          java.lang.Integer index,
                          java.lang.String def)

      Since:
        2.5

  - ### Method Detail

    - #### construct

          @Deprecated
          public static PropertyMetadata construct(boolean req,
                                              java.lang.String desc)

      Deprecated.
      Since:
        2.4 Use variant that takes more arguments.

    - #### construct

          public static PropertyMetadata construct(boolean req,
                                   java.lang.String desc,
                                   java.lang.Integer index,
                                   java.lang.String defaultValue)

    - #### readResolve

          protected java.lang.Object readResolve()

      Minor optimization: let's canonicalize back to placeholders in cases where there is no real data to consider

    - #### withDescription

          public PropertyMetadata withDescription(java.lang.String desc)

    - #### withDefaultValue

          public PropertyMetadata withDefaultValue(java.lang.String def)

    - #### withIndex

          public PropertyMetadata withIndex(java.lang.Integer index)

    - #### withRequired

          public PropertyMetadata withRequired(java.lang.Boolean b)

    - #### getDescription

          public java.lang.String getDescription()

    - #### getDefaultValue

          public java.lang.String getDefaultValue()

      Since:
        2.5

    - #### hasDefuaultValue

          @Deprecated
          public boolean hasDefuaultValue()

      Deprecated. Since 2.6: typo in name, use `hasDefaultValue()` instead.

    - #### hasDefaultValue

          public boolean hasDefaultValue()

      Accessor for determining whether property has declared "default value", which may be used by extension modules.
      Since:
        2.6

    - #### isRequired

          public boolean isRequired()

    - #### getRequired

          public java.lang.Boolean getRequired()

    - #### getIndex

          public java.lang.Integer getIndex()

      Since:
        2.4

    - #### hasIndex

          public boolean hasIndex()

      Since:
        2.4