Class StringToStringSerialiser
- java.lang.Object
-
- uk.gov.gchq.gaffer.serialisation.implementation.tostring.StringToStringSerialiser
-
- All Implemented Interfaces:
Serializable
,Serialiser<String,String>
,ToStringSerialiser<String>
public class StringToStringSerialiser extends Object implements ToStringSerialiser<String>
AStringToStringSerialiser
serialises aString
to aString
without performing any additional changes to the original object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StringToStringSerialiser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(Class clazz)
Check whether the serialiser can serialise a particular class.String
deserialise(String s)
Deserialise an String into the original object.boolean
isConsistent()
Indicates whether the serialisation process produces a predictable, consistent OUTPUT, from a given INPUT, ie the same object should always serialise in the same way for this to be true.boolean
preservesObjectOrdering()
Indicates whether the serialisation process preserves the ordering of the INPUT, i.e.String
serialise(String object)
Serialise some object and returns the String of the serialised form.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.serialisation.ToStringSerialiser
deserialiseEmpty, serialiseNull
-
-
-
-
Method Detail
-
canHandle
public boolean canHandle(Class clazz)
Check whether the serialiser can serialise a particular class.- Specified by:
canHandle
in interfaceSerialiser<String,String>
- Parameters:
clazz
- the object class to serialise- Returns:
- boolean true if it can be handled
-
serialise
public String serialise(String object) throws SerialisationException
Serialise some object and returns the String of the serialised form.- Specified by:
serialise
in interfaceSerialiser<String,String>
- Parameters:
object
- the object to be serialised- Returns:
- String the serialised String
- Throws:
SerialisationException
- if the object fails to serialise
-
deserialise
public String deserialise(String s) throws SerialisationException
Deserialise an String into the original object.- Specified by:
deserialise
in interfaceSerialiser<String,String>
- Parameters:
s
- the String to deserialise- Returns:
- INPUT the deserialised object
- Throws:
SerialisationException
- if the object fails to deserialise
-
preservesObjectOrdering
public boolean preservesObjectOrdering()
Indicates whether the serialisation process preserves the ordering of the INPUT, i.e. if x and y are objects of class INPUT, and x is less than y, then this method should return true if the serialised form of x is guaranteed to be less than the serialised form of y (using the standard ordering of String). If INPUT is not Comparable then this test makes no sense and false should be returned.- Specified by:
preservesObjectOrdering
in interfaceSerialiser<String,String>
- Returns:
- true if the serialisation will preserve the order of the INPUT, otherwise false.
-
isConsistent
public boolean isConsistent()
Description copied from interface:Serialiser
Indicates whether the serialisation process produces a predictable, consistent OUTPUT, from a given INPUT, ie the same object should always serialise in the same way for this to be true.- Specified by:
isConsistent
in interfaceSerialiser<String,String>
- Returns:
- true if serialisation is consistent for a given object, otherwise false.
-
-