Class PropertiesSerialiser<T>
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.serialiser.PropertiesSerialiser<T>
-
- All Implemented Interfaces:
Serializable,Serialiser<T,byte[]>,ToBytesSerialiser<T>
- Direct Known Subclasses:
EdgeSerialiser,ElementSerialiser,EntitySerialiser,GroupedPropertiesSerialiser
public abstract class PropertiesSerialiser<T> extends Object implements ToBytesSerialiser<T>
Serialiser to serialise and deserialise objects containingPropertiesin a byte array representation.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface uk.gov.gchq.gaffer.serialisation.ToBytesSerialiser
EMPTY_BYTES
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(Class clazz)Check whether the serialiser can serialise a particular class.booleanequals(Object obj)inthashCode()booleanpreservesObjectOrdering()Indicates whether the serialisation process preserves the ordering of the T, i.e.voidupdateSchema(Schema schema)-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.gov.gchq.gaffer.serialisation.Serialiser
isConsistent
-
Methods inherited from interface uk.gov.gchq.gaffer.serialisation.ToBytesSerialiser
deserialise, deserialise, deserialiseEmpty, serialise, serialiseNull
-
-
-
-
Method Detail
-
updateSchema
public void updateSchema(Schema schema)
-
canHandle
public boolean canHandle(Class clazz)
Description copied from interface:SerialiserCheck whether the serialiser can serialise a particular class.//Warning: Due to erasure you may get false positives. e.g.
Set<Foo> set = Sets.newHashSet(); boolean b = new Serialiser<Set<Bar>, byte[]>().canHandle(set.getClass()); b will incorrectly be true because of type erasure between Set<Foo> Set<Bar>- Specified by:
canHandlein interfaceSerialiser<T,byte[]>- Parameters:
clazz- the object class to serialise- Returns:
- boolean true if it can be handled
-
preservesObjectOrdering
public boolean preservesObjectOrdering()
Description copied from interface:ToBytesSerialiserIndicates whether the serialisation process preserves the ordering of the T, i.e. if x and y are objects of class T, 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 byte arrays). If T is not Comparable then this test makes no sense and false should be returned.- Specified by:
preservesObjectOrderingin interfaceSerialiser<T,byte[]>- Specified by:
preservesObjectOrderingin interfaceToBytesSerialiser<T>- Returns:
- true if the serialisation will preserve the order of the T, otherwise false.
-
-