Interface JsonSupport

  • All Known Implementing Classes:
    JavaJsonSupport$, JsonSupport$

    public interface JsonSupport
    Supports conversion of commands, state variables and events to/from JSON
    • Method Detail

      • writes

        <T> play.api.libs.json.JsValue writes​(T x,
                                              io.bullet.borer.Encoder<T> evidence$1)
      • reads

        <T> T reads​(play.api.libs.json.JsValue x,
                    io.bullet.borer.Decoder<T> evidence$2)
      • writeSequenceCommand

        play.api.libs.json.JsValue writeSequenceCommand​(SequenceCommand result)
        Writes a SequenceParameterSet to JSON

        Parameters:
        result - any instance of SequenceCommand
        Returns:
        a JsValue object representing the SequenceCommand
      • readSequenceCommand

        <A extends SequenceCommand> A readSequenceCommand​(play.api.libs.json.JsValue json)
        Reads a SequenceCommand back from JSON

        Parameters:
        json - the parsed JSON
        Returns:
        an instance of the given SequenceCommand type, or an exception if the JSON is not valid for that type
      • writeStateVariable

        play.api.libs.json.JsValue writeStateVariable​(StateVariable stateVariable)
        Writes a state variable to JSON

        Parameters:
        stateVariable - any instance of StateVariable
        Returns:
        a JsValue object representing the StateVariable
      • readStateVariable

        <A extends StateVariable> A readStateVariable​(play.api.libs.json.JsValue json)
        Reads a StateVariable back from JSON

        Parameters:
        json - the parsed JSON
        Returns:
        an instance of the given StateVariable, or an exception if the JSON is not valid for that type
      • writeEvent

        play.api.libs.json.JsValue writeEvent​(Event event)
        Writes an event to JSON

        Parameters:
        event - any instance of EventType
        Returns:
        a JsValue object representing the event
      • readEvent

        <A extends Event> A readEvent​(play.api.libs.json.JsValue json)
        Reads an event back from JSON

        Parameters:
        json - the parsed JSON
        Returns:
        an instance of the given event type, or an exception if the JSON is not valid for that type
      • writeResult

        play.api.libs.json.JsValue writeResult​(Result result)
        Writes a Result to JSON

        Parameters:
        result - any instance of Result
        Returns:
        a JsValue object representing the Result
      • readResult

        Result readResult​(play.api.libs.json.JsValue json)
        Reads a Result back from JSON

        Parameters:
        json - the parsed JSON
        Returns:
        an instance of Result, or an exception if the JSON is not valid for that type