Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.type

public Class MapLikeType

extends TypeBase
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.databind.type.MapType
Imports
java.lang.reflect.TypeVariable, java.util.*, com.fasterxml.jackson.databind.JavaType

Type that represents Map-like types; things that consist of key/value pairs but that do not necessarily implement java.util.Map, but that do not have enough introspection functionality to allow for some level of generic handling. This specifically allows framework to check for configuration and annotation settings used for Map types, and pass these to custom handlers that may be more familiar with actual type.

Field Summary

Modifier and TypeField and Description
protected final JavaType
_keyType

Type of keys of Map.

protected final JavaType
_valueType

Type of values of Map.

private static final long
Inherited from com.fasterxml.jackson.databind.type.TypeBase:
_bindings_canonicalName_superClass_superInterfaces

Constructor Summary

AccessConstructor and Description
protected
MapLikeType(Class<?> mapType, TypeBindings bindings, JavaType superClass, JavaType[] superInts, JavaType keyT, JavaType valueT, Object valueHandler, Object typeHandler, boolean asStatic)

protected
MapLikeType(TypeBase base, JavaType keyT, JavaType valueT)

Method Summary

Modifier and TypeMethod and Description
protected String
public static MapLikeType
construct(Class<?> rawType, JavaType keyT, JavaType valueT)

Deprecated
public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract com.fasterxml.jackson.databind.JavaType.equals.

Indicates whether some other object is "equal to" this one.
public JavaType
getContentType()

Overrides com.fasterxml.jackson.databind.JavaType.getContentType.

Method for accessing content type of this type, if type has such a thing: simple types do not, structured types do (like arrays, Collections and Maps)
public Object
getContentTypeHandler()

Overrides com.fasterxml.jackson.databind.JavaType.getContentTypeHandler.

Internal accessor that should not be used by any code outside of jackson-databind: only used internally by databind.
public Object
getContentValueHandler()

Overrides com.fasterxml.jackson.databind.JavaType.getContentValueHandler.

Internal accessor that should not be used by any code outside of jackson-databind: only used internally by databind.
public StringBuilder
getErasedSignature(StringBuilder
StringBuilder to append signature to
sb
)

Implements abstract com.fasterxml.jackson.databind.type.TypeBase.getErasedSignature.

Method for accessing signature without generic type information, in form compatible with all versions of JVM, and specifically used for type descriptions when generating byte code.
public StringBuilder
public JavaType
getKeyType()

Overrides com.fasterxml.jackson.databind.JavaType.getKeyType.

Method for accessing key type for this type, assuming type has such a concept (only Map types do)
public boolean
hasHandlers()

Overrides com.fasterxml.jackson.databind.JavaType.hasHandlers.

Helper method that checks whether this type, or its (optional) key or content type has getValueHandler or getTypeHandler(); that is, are there any non-standard handlers associated with this type object.
public boolean
public boolean
public boolean
isTrueMapType()

Deprecated Since 2.12 just use instanceof
Method that can be used for checking whether this type is a "real" Collection type; meaning whether it represents a parameterized subtype of java.util.Collection or just something that acts like one.
public JavaType
refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)

Implements abstract com.fasterxml.jackson.databind.JavaType.refine.

Mutant factory method that will try to create and return a sub-type instance for known parameterized types; for other types will return `null` to indicate that no just refinement makes necessary sense, without trying to detect special status through implemented interfaces.
public String
toString()

Implements abstract com.fasterxml.jackson.databind.JavaType.toString.

Returns a string representation of the object.
public static MapLikeType
upgradeFrom(JavaType baseType, JavaType keyT, JavaType valueT)

Factory method that can be used to "upgrade" a basic type into collection-like one; usually done via TypeModifier

public JavaType
withContentType(JavaType contentType)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentType.

Mutant factory method that may be called on structured types that have a so-called content type (element of arrays, value type of Maps, referenced type of referential types), and will construct a new instance that is identical to this instance, except that it has specified content type, instead of current one.
public MapLikeType
withContentTypeHandler(Object
Handler to pass to new instance created
h
)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.
public MapLikeType
withContentValueHandler(Object
Handler to pass to new instance created
h
)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.
public JavaType
withHandlersFrom(JavaType src)

Overrides com.fasterxml.jackson.databind.JavaType.withHandlersFrom.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.
public MapLikeType
public MapLikeType
public MapLikeType
public MapLikeType
withStaticTyping()

Implements abstract com.fasterxml.jackson.databind.JavaType.withStaticTyping.

Method that can be called to get a type instance that indicates that values of the type should be handled using "static typing" for purposes of serialization (as opposed to "dynamic" aka runtime typing): meaning that no runtime information is needed for determining serializers to use.
public MapLikeType
withTypeHandler(Object
Handler to pass to new instance created
h
)

Implements abstract com.fasterxml.jackson.databind.JavaType.withTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.
public MapLikeType
withValueHandler(Object
Handler to pass to new instance created
h
)

Implements abstract com.fasterxml.jackson.databind.JavaType.withValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind.
Inherited from com.fasterxml.jackson.databind.type.TypeBase:
_bogusSuperClass_classSignature_hasNTypeParameterscontainedTypecontainedTypeCountcontainedTypeNamefindSuperTypefindTypeParametersgetBindingsgetInterfacesgetSuperClassserializeserializeWithTypetoCanonical

Field Detail

_keyTypeback to summary
protected final JavaType _keyType

Type of keys of Map.

_valueTypeback to summary
protected final JavaType _valueType

Type of values of Map.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.type.TypeBase.serialVersionUID.

Constructor Detail

MapLikeTypeback to summary
protected MapLikeType(Class<?> mapType, TypeBindings bindings, JavaType superClass, JavaType[] superInts, JavaType keyT, JavaType valueT, Object valueHandler, Object typeHandler, boolean asStatic)
MapLikeTypeback to summary
protected MapLikeType(TypeBase base, JavaType keyT, JavaType valueT)
Since
2.7

Method Detail

buildCanonicalNameback to summary
protected String buildCanonicalName()

Overrides com.fasterxml.jackson.databind.type.TypeBase.buildCanonicalName.

Annotations
@Override
constructback to summary
public static MapLikeType construct(Class<?> rawType, JavaType keyT, JavaType valueT)

Deprecated

Annotations
@Deprecated
equalsback to summary
public boolean equals(Object o)

Implements abstract com.fasterxml.jackson.databind.JavaType.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getContentTypeback to summary
public JavaType getContentType()

Overrides com.fasterxml.jackson.databind.JavaType.getContentType.

Doc from com.fasterxml.jackson.core.type.ResolvedType.getContentType.

Method for accessing content type of this type, if type has such a thing: simple types do not, structured types do (like arrays, Collections and Maps)

Returns:JavaType

Content type of this type, if any; null if none

Annotations
@Override
getContentTypeHandlerback to summary
public Object getContentTypeHandler()

Overrides com.fasterxml.jackson.databind.JavaType.getContentTypeHandler.

Doc from com.fasterxml.jackson.databind.JavaType.getContentTypeHandler.

Internal accessor that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

Returns:Object

Content type handler associated with this type, if any.

Annotations
@Override
getContentValueHandlerback to summary
public Object getContentValueHandler()

Overrides com.fasterxml.jackson.databind.JavaType.getContentValueHandler.

Doc from com.fasterxml.jackson.databind.JavaType.getContentValueHandler.

Internal accessor that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

Returns:Object

Content value handler associated with this type, if any.

Annotations
@Override
getErasedSignatureback to summary
public StringBuilder getErasedSignature(StringBuilder sb)

Implements abstract com.fasterxml.jackson.databind.type.TypeBase.getErasedSignature.

Doc from com.fasterxml.jackson.databind.JavaType.getErasedSignature.

Method for accessing signature without generic type information, in form compatible with all versions of JVM, and specifically used for type descriptions when generating byte code.

Parameters
sb:StringBuilder

StringBuilder to append signature to

Returns:StringBuilder

StringBuilder that was passed in; returned to allow call chaining

Annotations
@Override
getGenericSignatureback to summary
public StringBuilder getGenericSignature(StringBuilder sb)

Implements abstract com.fasterxml.jackson.databind.type.TypeBase.getGenericSignature.

Parameters
sb:StringBuilder

Doc from com.fasterxml.jackson.databind.JavaType.getGenericSignature.

StringBuilder to append signature to

Returns:StringBuilder

Doc from com.fasterxml.jackson.databind.JavaType.getGenericSignature.

StringBuilder that was passed in; returned to allow call chaining

Annotations
@Override
getKeyTypeback to summary
public JavaType getKeyType()

Overrides com.fasterxml.jackson.databind.JavaType.getKeyType.

Doc from com.fasterxml.jackson.core.type.ResolvedType.getKeyType.

Method for accessing key type for this type, assuming type has such a concept (only Map types do)

Returns:JavaType

Key type of this type, if any; null if none

Annotations
@Override
hasHandlersback to summary
public boolean hasHandlers()

Overrides com.fasterxml.jackson.databind.JavaType.hasHandlers.

Doc from com.fasterxml.jackson.databind.JavaType.hasHandlers.

Helper method that checks whether this type, or its (optional) key or content type has getValueHandler or getTypeHandler(); that is, are there any non-standard handlers associated with this type object.

Annotations
@Override
isContainerTypeback to summary
public boolean isContainerType()

Implements abstract com.fasterxml.jackson.databind.JavaType.isContainerType.

Returns:boolean

Doc from com.fasterxml.jackson.databind.JavaType.isContainerType.

True if type represented is a container type; this includes array, Map and Collection types.

Annotations
@Override
isMapLikeTypeback to summary
public boolean isMapLikeType()

Overrides com.fasterxml.jackson.databind.JavaType.isMapLikeType.

Returns:boolean

Doc from com.fasterxml.jackson.databind.JavaType.isMapLikeType.

True if type is either true java.util.Map type, or something similar (meaning it has at least two type parameter; first one describing key type, second value type)

Annotations
@Override
isTrueMapTypeback to summary
public boolean isTrueMapType()

Deprecated

Since 2.12 just use instanceof

Method that can be used for checking whether this type is a "real" Collection type; meaning whether it represents a parameterized subtype of java.util.Collection or just something that acts like one.

Annotations
@Deprecated
refineback to summary
public JavaType refine(Class<?> rawType, TypeBindings bindings, JavaType superClass, JavaType[] superInterfaces)

Implements abstract com.fasterxml.jackson.databind.JavaType.refine.

Doc from com.fasterxml.jackson.databind.JavaType.refine.

Mutant factory method that will try to create and return a sub-type instance for known parameterized types; for other types will return `null` to indicate that no just refinement makes necessary sense, without trying to detect special status through implemented interfaces.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract com.fasterxml.jackson.databind.JavaType.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
upgradeFromback to summary
public static MapLikeType upgradeFrom(JavaType baseType, JavaType keyT, JavaType valueT)

Factory method that can be used to "upgrade" a basic type into collection-like one; usually done via TypeModifier

Since
2.7
withContentTypeback to summary
public JavaType withContentType(JavaType contentType)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentType.

Doc from com.fasterxml.jackson.databind.JavaType.withContentType.

Mutant factory method that may be called on structured types that have a so-called content type (element of arrays, value type of Maps, referenced type of referential types), and will construct a new instance that is identical to this instance, except that it has specified content type, instead of current one. If content type is already set to given type, this is returned. If type does not have a content type (which is the case with SimpleType), IllegalArgumentException will be thrown.

Returns:JavaType

Newly created type instance

Annotations
@Override
withContentTypeHandlerback to summary
public MapLikeType withContentTypeHandler(Object h)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentTypeHandler.

Doc from com.fasterxml.jackson.databind.JavaType.withContentTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified content type (element type for arrays, value type for Maps and so forth) handler assigned.

Parameters
h:Object

Handler to pass to new instance created

Returns:MapLikeType

Newly created type instance with same type information, specified handler

Annotations
@Override
withContentValueHandlerback to summary
public MapLikeType withContentValueHandler(Object h)

Implements abstract com.fasterxml.jackson.databind.JavaType.withContentValueHandler.

Doc from com.fasterxml.jackson.databind.JavaType.withContentValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

Mutant factory method that will construct a new instance that is identical to this instance, except that it will have specified content value handler assigned.

Parameters
h:Object

Handler to pass to new instance created

Returns:MapLikeType

Newly created type instance with same type information, specified handler

Annotations
@Override
withHandlersFromback to summary
public JavaType withHandlersFrom(JavaType src)

Overrides com.fasterxml.jackson.databind.JavaType.withHandlersFrom.

Doc from com.fasterxml.jackson.databind.JavaType.withHandlersFrom.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

Mutant factory method that will try to copy handlers that the specified source type instance had, if any; this must be done recursively where necessary (as content types may be structured).

Annotations
@Override
withKeyTypeback to summary
public MapLikeType withKeyType(JavaType keyType)
Since
2.7
withKeyTypeHandlerback to summary
public MapLikeType withKeyTypeHandler(Object h)
withKeyValueHandlerback to summary
public MapLikeType withKeyValueHandler(Object h)
withStaticTypingback to summary
public MapLikeType withStaticTyping()

Implements abstract com.fasterxml.jackson.databind.JavaType.withStaticTyping.

Doc from com.fasterxml.jackson.databind.JavaType.withStaticTyping.

Method that can be called to get a type instance that indicates that values of the type should be handled using "static typing" for purposes of serialization (as opposed to "dynamic" aka runtime typing): meaning that no runtime information is needed for determining serializers to use. The main use case is to allow forcing of specific root value serialization type, and specifically in resolving serializers for contained types (element types for arrays, Collections and Maps).

Annotations
@Override
withTypeHandlerback to summary
public MapLikeType withTypeHandler(Object h)

Implements abstract com.fasterxml.jackson.databind.JavaType.withTypeHandler.

Doc from com.fasterxml.jackson.databind.JavaType.withTypeHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified type handler assigned.

Parameters
h:Object

Handler to pass to new instance created

Returns:MapLikeType

Newly created type instance with same type information, specified handler

Annotations
@Override
withValueHandlerback to summary
public MapLikeType withValueHandler(Object h)

Implements abstract com.fasterxml.jackson.databind.JavaType.withValueHandler.

Doc from com.fasterxml.jackson.databind.JavaType.withValueHandler.

Internal method that should not be used by any code outside of jackson-databind: only used internally by databind. May be removed from Jackson 3.0.

This mutant factory method will construct a new instance that is identical to this instance, except that it will have specified value handler assigned.

Parameters
h:Object

Handler to pass to new instance created

Returns:MapLikeType

Newly created type instance with same type information, specified handler

Annotations
@Override