Class MapConverter<K,V>
- java.lang.Object
-
- com.oracle.coherence.io.json.internal.MapConverter<K,V>
-
- Type Parameters:
K- the type of the map keysV- the type of the map values
- All Implemented Interfaces:
Converter<Map<K,V>>,Deserializer<Map<K,V>>,Serializer<Map<K,V>>
@HandleClassMetadata public class MapConverter<K,V> extends Object implements Converter<Map<K,V>>
Map converter.NOTE: this
Converterproduces a serialization format that is incompatible with other JSON parsers.- Since:
- 20.06
- Author:
- Aleks Seovic 2018.05.30
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapConverter.FactoryAMapConverterfactory.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMapConverter(Converter<K> convKey, Converter<V> convValue)Constructs a newMapConverterusing the providedconvertersto convert keys and values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<K,V>deserialize(ObjectReader reader, Context ctx)voidserialize(Map<K,V> object, ObjectWriter writer, Context ctx)
-
-
-
Method Detail
-
serialize
public void serialize(Map<K,V> object, ObjectWriter writer, Context ctx) throws Exception
- Specified by:
serializein interfaceConverter<K>- Specified by:
serializein interfaceSerializer<K>- Parameters:
object- we want to serialize. The object is of type T or a subclass (if this serializer has been registered for subclasses).writer- to use to write data to the output stream.ctx- the current context.- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
deserialize
public Map<K,V> deserialize(ObjectReader reader, Context ctx) throws Exception
- Specified by:
deserializein interfaceConverter<K>- Specified by:
deserializein interfaceDeserializer<K>- Parameters:
reader- used to read data from.ctx- the current context.- Returns:
- an instance of T or a subclass of T.
- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
-