Class SerializerImpl
- java.lang.Object
-
- com.backpackcloud.zipper.impl.serializer.SerializerImpl
-
- All Implemented Interfaces:
Serializer
public class SerializerImpl extends Object implements Serializer
-
-
Constructor Summary
Constructors Constructor Description SerializerImpl(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E> SerializeraddDependency(Class<E> type, E dependency)SerializeraddDependency(String name, Object dependency)<E> Edeserialize(File file, Class<E> type)Deserialize the given file content into an object of the given class.<E> Edeserialize(InputStream input, Class<E> type)Deserialize the given input into an object of the given class.<E> Edeserialize(String input, Class<E> type)Deserialize the given input into an object of the given class.Stringserialize(Object object)Serializes the given object into a String.
-
-
-
Method Detail
-
addDependency
public Serializer addDependency(String name, Object dependency)
- Specified by:
addDependencyin interfaceSerializer
-
addDependency
public <E> Serializer addDependency(Class<E> type, E dependency)
- Specified by:
addDependencyin interfaceSerializer
-
serialize
public String serialize(Object object)
Description copied from interface:SerializerSerializes the given object into a String.- Specified by:
serializein interfaceSerializer- Parameters:
object- the object to serialize- Returns:
- the serialized object.
-
deserialize
public <E> E deserialize(String input, Class<E> type)
Description copied from interface:SerializerDeserialize the given input into an object of the given class.- Specified by:
deserializein interfaceSerializer- Parameters:
input- the input to deserializetype- the type of the result object- Returns:
- the deserialized object.
-
deserialize
public <E> E deserialize(File file, Class<E> type)
Description copied from interface:SerializerDeserialize the given file content into an object of the given class.- Specified by:
deserializein interfaceSerializer- Parameters:
file- the file containing the input to deserializetype- the type of the result object- Returns:
- the deserialized object.
-
deserialize
public <E> E deserialize(InputStream input, Class<E> type)
Description copied from interface:SerializerDeserialize the given input into an object of the given class.- Specified by:
deserializein interfaceSerializer- Parameters:
input- the input to deserializetype- the type of the result object- Returns:
- the deserialized object.
-
-