Class ComparableConverter
- java.lang.Object
-
- com.oracle.coherence.io.json.internal.ComparableConverter
-
- All Implemented Interfaces:
Converter<Comparable>,Deserializer<Comparable>,Serializer<Comparable>
public class ComparableConverter extends Object implements Converter<Comparable>
AConverterforComparableinstances. Specifically, this handles the case where the raw value being processed is a JSON String, Number, or Boolean. If the type being handled isn't any of those, allow otherconvertersto process the value.- Since:
- 20.06
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComparableConverter.FactoryA factory for creatingComparableConverters.
-
Field Summary
Fields Modifier and Type Field Description static ComparableConverterINSTANCESingleton instance forComparableConverter.
-
Constructor Summary
Constructors Modifier Constructor Description protectedComparableConverter()Creates a newComparableConverter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparabledeserialize(ObjectReader reader, Context ctx)voidserialize(Comparable object, ObjectWriter writer, Context ctx)
-
-
-
Field Detail
-
INSTANCE
public static final ComparableConverter INSTANCE
Singleton instance forComparableConverter.
-
-
Method Detail
-
deserialize
public Comparable deserialize(ObjectReader reader, Context ctx) throws Exception
- Specified by:
deserializein interfaceConverter<Comparable>- Specified by:
deserializein interfaceDeserializer<Comparable>- Parameters:
reader- used to read data from.ctx- the current context.- Returns:
- an instance of T or a subclass of T.
- Throws:
JsonBindingExceptionJsonStreamExceptionException
-
serialize
public void serialize(Comparable object, ObjectWriter writer, Context ctx) throws Exception
- Specified by:
serializein interfaceConverter<Comparable>- Specified by:
serializein interfaceSerializer<Comparable>- 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
-
-