Interface StorageSerializer<Type>

    • Method Detail

      • serialize

        @Nonnull
        @NotEmpty
        String serialize​(@Nonnull
                         Type instance)
                  throws IOException
        Returns a string representing the input object.
        Parameters:
        instance - object to serialize
        Returns:
        a string
        Throws:
        IOException - if an error occurs during serialization
      • deserialize

        @Nonnull
        Type deserialize​(long version,
                         @Nonnull @NotEmpty
                         String context,
                         @Nonnull @NotEmpty
                         String key,
                         @Nonnull @NotEmpty
                         String value,
                         @Nullable
                         Long expiration)
                  throws IOException
        Returns an object recovered from a string produced through the serialize(Type) method.
        Parameters:
        version - record version
        context - context of record
        key - key of record
        value - data to deserialize
        expiration - expiration of record, if any
        Returns:
        a deserialized object
        Throws:
        IOException - if an error occurs during deserialization