Class JacksonStateSerDes

  • All Implemented Interfaces:
    StateSerDes

    @Singleton
    public class JacksonStateSerDes
    extends java.lang.Object
    implements StateSerDes
    Jackson based implementation for state serdes.
    Since:
    1.2.0
    Author:
    James Kleeh
    • Constructor Summary

      Constructors 
      Constructor Description
      JacksonStateSerDes​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      State deserialize​(java.lang.String state)
      De-serializes the state string into a State object.
      java.lang.String serialize​(State state)
      Serializes the state into a string for sending with the authorization redirect.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JacksonStateSerDes

        public JacksonStateSerDes​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Parameters:
        objectMapper - To serialize/de-serialize the state
    • Method Detail

      • deserialize

        public State deserialize​(java.lang.String state)
        Description copied from interface: StateSerDes
        De-serializes the state string into a State object.
        Specified by:
        deserialize in interface StateSerDes
        Parameters:
        state - The state string
        Returns:
        The state, or null if the de-serialization encountered an error.
      • serialize

        public java.lang.String serialize​(State state)
        Description copied from interface: StateSerDes
        Serializes the state into a string for sending with the authorization redirect.
        Specified by:
        serialize in interface StateSerDes
        Parameters:
        state - The state object
        Returns:
        The serialized state, or null if the serialization encountered an error.