public abstract class KeySerializer<T> extends Object
Map key serializer. It handles null values and exceptions. The rest is delegated to implementations.| Constructor and Description |
|---|
KeySerializer() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
doSerialize(T value,
JsonSerializationContext ctx)
Serializes a non-null object into a
String to use as map's key. |
boolean |
mustBeEscaped(JsonSerializationContext ctx)
mustBeEscaped
|
String |
serialize(T value,
JsonSerializationContext ctx)
Serializes an object into a
String to use as map's key. |
public boolean mustBeEscaped(JsonSerializationContext ctx)
mustBeEscaped
ctx - Context for the full serialization processpublic String serialize(T value, JsonSerializationContext ctx) throws JsonSerializationException
String to use as map's key.value - Object to serializectx - Context for the full serialization processJsonSerializationException - if an error occurs during the serializationprotected abstract String doSerialize(T value, JsonSerializationContext ctx)
String to use as map's key.value - Object to serializectx - Context for the full serialization processCopyright © 2019. All rights reserved.