Package uk.gov.gchq.gaffer.store
Class SerialisationFactory
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.SerialisationFactory
-
- Direct Known Subclasses:
AccumuloSerialisationFactory
public class SerialisationFactory extends Object
ASerialisationFactory
holds a list of core serialisers and is design to provide compatible serialisers for given object classes.
-
-
Constructor Summary
Constructors Constructor Description SerialisationFactory()
SerialisationFactory(Serialiser... serialisers)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSerialisers(Serialiser... newSerialisers)
Adds a list ofSerialiser
to be used within the SerialisationFactory.Serialiser
getSerialiser(Class<?> objClass)
Serialiser
getSerialiser(Class<?> objClass, boolean preserveOrder, boolean consistentSerialiser)
List<Serialiser>
getSerialisers()
-
-
-
Constructor Detail
-
SerialisationFactory
public SerialisationFactory()
-
SerialisationFactory
public SerialisationFactory(Serialiser... serialisers)
Constructor.- Parameters:
serialisers
- a list of Serialisers.
-
-
Method Detail
-
getSerialisers
public List<Serialiser> getSerialisers()
- Returns:
- List of set Serialisers.
-
addSerialisers
public void addSerialisers(Serialiser... newSerialisers)
Adds a list ofSerialiser
to be used within the SerialisationFactory.- Parameters:
newSerialisers
- a list of Serialisers.
-
getSerialiser
public Serialiser getSerialiser(Class<?> objClass)
- Parameters:
objClass
- the class of an object to be serialised.- Returns:
- a compatible serialiser.
- Throws:
IllegalArgumentException
- if the object class parameter is null or no compatible serialiser could be found.
-
getSerialiser
public Serialiser getSerialiser(Class<?> objClass, boolean preserveOrder, boolean consistentSerialiser)
- Parameters:
objClass
- the class of an object to be serialised.preserveOrder
- if true then the returned serialiser should preserve order.consistentSerialiser
- if true then the returned serialiser should be consistent- Returns:
- a compatible serialiser.
- Throws:
IllegalArgumentException
- if the object class parameter is null or no compatible serialiser could be found.
-
-