com.fasterxml.jackson.databind.jsontype.impl

## Class MinimalClassNameIdResolver

- java.lang.Object
- - com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase
  - - com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver
    - - com.fasterxml.jackson.databind.jsontype.impl.MinimalClassNameIdResolver

All Implemented Interfaces:
  TypeIdResolver, Serializable

    public class MinimalClassNameIdResolver
    extends ClassNameIdResolver

Specialization of `ClassNameIdResolver` that instead uses a "minimal" derivation of `Class` name, using relative reference from the base type (base class) that polymorphic value has.

See Also:
  Serialized Form

### Field Summary

Fields
`protected String` `_basePackageName` Package name of the base class, to be used for determining common prefix that can be omitted from included type id.
`protected String` `_basePackagePrefix` Same as `_basePackageName`, but includes trailing dot.

### Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver

`_allowedSubtypes, _subTypeValidator`

### Fields inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

`_baseType, _typeFactory`

### Constructor Summary

Constructors
`protected` `MinimalClassNameIdResolver(JavaType baseType, TypeFactory typeFactory, Collection<NamedType> subtypes, PolymorphicTypeValidator ptv)`
`protected` `MinimalClassNameIdResolver(JavaType baseType, TypeFactory typeFactory, PolymorphicTypeValidator ptv)` Deprecated. since 2.19

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`protected JavaType` `_typeFromId(String id, DatabindContext ctxt)`
`static MinimalClassNameIdResolver` `construct(JavaType baseType, MapperConfig<?> config, Collection<NamedType> subtypes, PolymorphicTypeValidator ptv)`
`static MinimalClassNameIdResolver` `construct(JavaType baseType, MapperConfig<?> config, PolymorphicTypeValidator ptv)` Deprecated. since 2.19
`JsonTypeInfo.Id` `getMechanism()` Accessor for mechanism that this resolver uses for determining type id from type.
`String` `idFromValue(Object value)` Method called to serialize type of the type of given value as a String to include in serialized JSON content.
`String` `idFromValueAndType(Object value, Class<?> rawType)` Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type.

### Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver

`_idFrom, getDescForKnownTypeIds, registerSubtype, typeFromId`

### Methods inherited from class com.fasterxml.jackson.databind.jsontype.impl.TypeIdResolverBase

`_resolveToParentAsNecessary, idFromBaseType, init`

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

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

### Field Detail

#### _basePackageName

    protected final String _basePackageName

Package name of the base class, to be used for determining common prefix that can be omitted from included type id. Does not include the trailing dot.

#### _basePackagePrefix

    protected final String _basePackagePrefix

Same as `_basePackageName`, but includes trailing dot.

### Constructor Detail

#### MinimalClassNameIdResolver

    @Deprecated
    protected MinimalClassNameIdResolver(JavaType baseType,
                                                     TypeFactory typeFactory,
                                                     PolymorphicTypeValidator ptv)

Deprecated. since 2.19

#### MinimalClassNameIdResolver

    protected MinimalClassNameIdResolver(JavaType baseType,
                                         TypeFactory typeFactory,
                                         Collection<NamedType> subtypes,
                                         PolymorphicTypeValidator ptv)

Since:
  2.19

### Method Detail

#### construct

    @Deprecated
    public static MinimalClassNameIdResolver construct(JavaType baseType,
                                                                   MapperConfig<?> config,
                                                                   PolymorphicTypeValidator ptv)

Deprecated. since 2.19

#### construct

    public static MinimalClassNameIdResolver construct(JavaType baseType,
                                                       MapperConfig<?> config,
                                                       Collection<NamedType> subtypes,
                                                       PolymorphicTypeValidator ptv)

Since:
  2.19

#### getMechanism

    public JsonTypeInfo.Id getMechanism()

Description copied from interface: `TypeIdResolver`
Accessor for mechanism that this resolver uses for determining type id from type. Mostly informational; not required to be called or used.

Specified by:
  `getMechanism` in interface `TypeIdResolver`
Overrides:
  `getMechanism` in class `ClassNameIdResolver`

#### idFromValue

    public String idFromValue(Object value)

Description copied from interface: `TypeIdResolver`
Method called to serialize type of the type of given value as a String to include in serialized JSON content.

Specified by:
  `idFromValue` in interface `TypeIdResolver`
Overrides:
  `idFromValue` in class `ClassNameIdResolver`

#### idFromValueAndType

    public String idFromValueAndType(Object value,
                                     Class<?> rawType)

Description copied from interface: `TypeIdResolver`
Alternative method used for determining type from combination of value and type, using suggested type (that serializer provides) and possibly value of that type. Most common implementation will use suggested type as is.

Specified by:
  `idFromValueAndType` in interface `TypeIdResolver`
Overrides:
  `idFromValueAndType` in class `ClassNameIdResolver`

#### _typeFromId

    protected JavaType _typeFromId(String id,
                                   DatabindContext ctxt)
                            throws IOException

Overrides:
  `_typeFromId` in class `ClassNameIdResolver`
Throws:
  `IOException`