Class SerialisationFactory

  • Direct Known Subclasses:
    AccumuloSerialisationFactory

    public class SerialisationFactory
    extends Object
    A SerialisationFactory holds a list of core serialisers and is design to provide compatible serialisers for given object classes.
    • 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 of Serialiser 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.