Interface Serializer

  • All Known Subinterfaces:
    StoreSerializer

    public interface Serializer
    Interface for serialization of store artifacts.
    • Method Detail

      • encode

        <T> byte[] encode​(T object)
        Serialize the specified object.
        Type Parameters:
        T - encoded type
        Parameters:
        object - object to serialize.
        Returns:
        serialized bytes.
      • decode

        <T> T decode​(byte[] bytes)
        Deserialize the specified bytes.
        Type Parameters:
        T - decoded type
        Parameters:
        bytes - byte array to deserialize.
        Returns:
        deserialized object.
      • copy

        <T> T copy​(T object)
        Copies the specified object.
        Type Parameters:
        T - object type
        Parameters:
        object - object to copy.
        Returns:
        copied object
      • using

        static Serializer using​(KryoNamespace kryo)
        Creates a new Serializer instance from a KryoNamespace.
        Parameters:
        kryo - kryo namespace
        Returns:
        Serializer instance
      • using

        static Serializer using​(KryoNamespace namespace,
                                Class<?>... classes)
        Creates a new Serializer instance from a KryoNamespace and some additional classes.
        Parameters:
        namespace - kryo namespace
        classes - variable length array of classes to register
        Returns:
        Serializer instance
      • using

        static Serializer using​(List<KryoNamespace> namespaces,
                                Class<?>... classes)
        Creates a new Serializer instance from a list of KryoNamespaces and some additional classes.
        Parameters:
        namespaces - kryo namespaces
        classes - variable length array of classes to register
        Returns:
        Serializer instance