Interface C2Serializer

All Known Implementing Classes:
C2JacksonSerializer

public interface C2Serializer
Helper class to support central configuration and functionality for serialisation / deserialisation
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Optional<T>
    deserialize(String content, Class<T> valueType)
    Helper to deserialise an object
    serialize(T content)
    Helper to serialise object
  • Method Details

    • serialize

      <T> Optional<String> serialize(T content)
      Helper to serialise object
      Type Parameters:
      T - the type of the object
      Parameters:
      content - object to be serialised
      Returns:
      the serialised string representation of the parameter object if it was successful empty otherwise
    • deserialize

      <T> Optional<T> deserialize(String content, Class<T> valueType)
      Helper to deserialise an object
      Type Parameters:
      T - the type of the target object
      Parameters:
      content - the string representation of the object to be deserialsed
      valueType - the class of the target object
      Returns:
      the deserialised object if successful empty otherwise