JsonSupport

csw.params.core.formats.JsonSupport
See theJsonSupport companion object
trait JsonSupport

Supports conversion of commands, state variables and events to/from JSON

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def readEvent[A <: Event](json: JsValue): A

Reads an event back from JSON

Reads an event back from JSON

Type parameters

A

the type of the event (use Any and match on the type if you don't know)

Value parameters

json

the parsed JSON

Attributes

Returns

an instance of the given event type, or an exception if the JSON is not valid for that type

Reads a Result back from JSON

Reads a Result back from JSON

Value parameters

json

the parsed JSON

Attributes

Returns

an instance of Result, or an exception if the JSON is not valid for that type

Reads a SequenceCommand back from JSON

Reads a SequenceCommand back from JSON

Type parameters

A

the type of the command (implied)

Value parameters

json

the parsed JSON

Attributes

Returns

an instance of the given SequenceCommand type, or an exception if the JSON is not valid for that type

Reads a StateVariable back from JSON

Reads a StateVariable back from JSON

Type parameters

A

the type of the StateVariable (implied)

Value parameters

json

the parsed JSON

Attributes

Returns

an instance of the given StateVariable, or an exception if the JSON is not valid for that type

def reads[T : Decoder](x: JsValue): T

Writes an event to JSON

Writes an event to JSON

Value parameters

event

any instance of EventType

Attributes

Returns

a JsValue object representing the event

Writes a Result to JSON

Writes a Result to JSON

Value parameters

result

any instance of Result

Attributes

Returns

a JsValue object representing the Result

Writes a SequenceParameterSet to JSON

Writes a SequenceParameterSet to JSON

Value parameters

result

any instance of SequenceCommand

Attributes

Returns

a JsValue object representing the SequenceCommand

Writes a state variable to JSON

Writes a state variable to JSON

Value parameters

stateVariable

any instance of StateVariable

Attributes

Returns

a JsValue object representing the StateVariable

def writes[T : Encoder](x: T): JsValue