Package com.fasterxml.jackson.annotation

# Enum JsonTypeInfo.As

java.lang.Object
java.lang.Enum<JsonTypeInfo.As>
com.fasterxml.jackson.annotation.JsonTypeInfo.As

All Implemented Interfaces:
  `Serializable`, `Comparable<JsonTypeInfo.As>`, `java.lang.constant.Constable`

Enclosing class:
  `JsonTypeInfo`

public static enum JsonTypeInfo.As extends Enum<JsonTypeInfo.As>
Definition of standard type inclusion mechanisms for type metadata. Used for standard metadata types, except for `JsonTypeInfo.Id.NONE`. May or may not be used for custom types (`JsonTypeInfo.Id.CUSTOM`).

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`EXISTING_PROPERTY`
Inclusion mechanism similar to `PROPERTY` with respect to deserialization; but one that is produced by a "regular" accessible property during serialization.
`EXTERNAL_PROPERTY`
Inclusion mechanism similar to `PROPERTY`, except that property is included one-level higher in hierarchy, i.e.
`PROPERTY`
Inclusion mechanism that uses a single configurable property, included along with actual data (POJO properties) as a separate meta-property.
`WRAPPER_ARRAY`
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a 2-element JSON array: first element is the serialized type identifier, and second element the serialized POJO as JSON Object.
`WRAPPER_OBJECT`
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a JSON Object that has a single entry, where field name is serialized type identifier, and value is the actual JSON value.

## Method Summary

Modifier and Type
Method
Description
`static JsonTypeInfo.As`
`valueOf(String name)`
Returns the enum constant of this type with the specified name.
`static JsonTypeInfo.As[]`
`values()`
Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### PROPERTY

public static final JsonTypeInfo.As PROPERTY
Inclusion mechanism that uses a single configurable property, included along with actual data (POJO properties) as a separate meta-property.

Default choice for inclusion.

### WRAPPER_OBJECT

public static final JsonTypeInfo.As WRAPPER_OBJECT
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a JSON Object that has a single entry, where field name is serialized type identifier, and value is the actual JSON value.

Note: can only be used if type information can be serialized as String. This is true for standard type metadata types, but not necessarily for custom types.

### WRAPPER_ARRAY

public static final JsonTypeInfo.As WRAPPER_ARRAY
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a 2-element JSON array: first element is the serialized type identifier, and second element the serialized POJO as JSON Object.

### EXTERNAL_PROPERTY

public static final JsonTypeInfo.As EXTERNAL_PROPERTY
Inclusion mechanism similar to `PROPERTY`, except that property is included one-level higher in hierarchy, i.e. as sibling property at same level as JSON Object to type. Note that this mechanism can only be used for properties, not for types (classes). Trying to use it for classes will result in inclusion strategy of basic `PROPERTY` instead.

Note also that this mechanism can not be used for container values (arrays, `Collection`s, `Map`s); it only works for scalar and POJO values.

### EXISTING_PROPERTY

public static final JsonTypeInfo.As EXISTING_PROPERTY
Inclusion mechanism similar to `PROPERTY` with respect to deserialization; but one that is produced by a "regular" accessible property during serialization. This means that `TypeSerializer` will do nothing, and expects a property with defined name to be output using some other mechanism (like default POJO property serialization, or custom serializer).

Note that this behavior is quite similar to that of using `JsonTypeId` annotation; except that here `TypeSerializer` is basically suppressed; whereas with `JsonTypeId`, output of regular property is suppressed. This mostly matters with respect to output order; this choice is the only way to ensure specific placement of type id during serialization.

Since:
  2.3.0 but databind only since 2.5.0.

## Method Details

### values

public static JsonTypeInfo.As[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

Returns:
  an array containing the constants of this enum type, in the order they are declared

### valueOf

public static JsonTypeInfo.As valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null