Interface Serializer

  • All Known Implementing Classes:
    SerializerImpl

    public interface Serializer
    Interface that exposes components for serializing different formats of input.
    • Method Detail

      • serialize

        String serialize​(Object object)
        Serializes the given object into a String.
        Parameters:
        object - the object to serialize
        Returns:
        the serialized object.
      • deserialize

        <E> E deserialize​(String input,
                          Class<E> type)
        Deserialize the given input into an object of the given class.
        Parameters:
        input - the input to deserialize
        type - the type of the result object
        Returns:
        the deserialized object.
      • deserialize

        <E> E deserialize​(File file,
                          Class<E> type)
        Deserialize the given file content into an object of the given class.
        Parameters:
        file - the file containing the input to deserialize
        type - the type of the result object
        Returns:
        the deserialized object.
      • deserialize

        <E> E deserialize​(InputStream input,
                          Class<E> type)
        Deserialize the given input into an object of the given class.
        Parameters:
        input - the input to deserialize
        type - the type of the result object
        Returns:
        the deserialized object.
      • addDependency

        <E> Serializer addDependency​(Class<E> type,
                                     E dependency)
      • json

        static Serializer json()
        Returns the mapper for json data type.
        Returns:
        the mapper for json data type.
      • yaml

        static Serializer yaml()
        Returns the mapper for the yaml data type.
        Returns:
        the mapper for the yaml data type.
      • using

        static Serializer using​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)