T - type of the adapterpublic interface TypeAdapter<T>
StandardSerializer.
Please note that classes implementing this interface must also be registered at the serializer instance used. See
StandardSerializer.register(Class, TypeAdapter).
| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(Map<Object,Object> map)
Deserializes the given map into instance of this type.
|
Map<Object,Object> |
serialize(T object)
Serializes the given instance into a map.
|
default Map<String,Object> |
toStringKeyedMap(Map<?,?> map)
|
@NotNull Map<Object,Object> serialize(@NotNull T object)
The returned map does not need to (but may) contain the type identifier wiki.
Type identifier is one entry in the top-level map (the one returned), where the key is defined by the serializer
(== for StandardSerializer.getDefault()) and the value identifies the serialized type - either by
the full canonical classname (e.g. me.name.project.objects.CustomObject) or it's alias. Both must
also be registered.
If the returned map does not contain the identifier, the serializer will automatically
use the full classname.
object - object to serialize@NotNull T deserialize(@NotNull Map<Object,Object> map)
The given map is a raw object map; there are no Block instances, just native Java objects themselves.
Use toStringKeyedMap(Map) to convert the map.
map - the raw map to deserializeCopyright © 2022. All rights reserved.