Package csw.params.core.formats
Interface JsonSupport
- All Known Implementing Classes:
JavaJsonSupport$
,JsonSupport$
public interface JsonSupport
Supports conversion of commands, state variables and events to/from JSON
-
Method Summary
Modifier and TypeMethodDescription<A extends Event>
AreadEvent
(play.api.libs.json.JsValue json) Reads an event back from JSONreadResult
(play.api.libs.json.JsValue json) Reads a Result back from JSON<T> T
reads
(play.api.libs.json.JsValue x, io.bullet.borer.Decoder<T> evidence$2) <A extends SequenceCommand>
AreadSequenceCommand
(play.api.libs.json.JsValue json) Reads a SequenceCommand back from JSON<A extends StateVariable>
AreadStateVariable
(play.api.libs.json.JsValue json) Reads a StateVariable back from JSONplay.api.libs.json.JsValue
writeEvent
(Event event) Writes an event to JSONplay.api.libs.json.JsValue
writeResult
(Result result) Writes a Result to JSON<T> play.api.libs.json.JsValue
writes
(T x, io.bullet.borer.Encoder<T> evidence$1) play.api.libs.json.JsValue
writeSequenceCommand
(SequenceCommand result) Writes a SequenceParameterSet to JSONplay.api.libs.json.JsValue
writeStateVariable
(StateVariable stateVariable) Writes a state variable to JSON
-
Method Details
-
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
Writes a SequenceParameterSet to JSON- Parameters:
result
- any instance of SequenceCommand- Returns:
- a JsValue object representing the SequenceCommand
-
readSequenceCommand
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
Writes a state variable to JSON- Parameters:
stateVariable
- any instance of StateVariable- Returns:
- a JsValue object representing the StateVariable
-
readStateVariable
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
Writes an event to JSON- Parameters:
event
- any instance of EventType- Returns:
- a JsValue object representing the event
-
readEvent
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
Writes a Result to JSON- Parameters:
result
- any instance of Result- Returns:
- a JsValue object representing the Result
-
readResult
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
-