trait JsonSupport extends MiscJsonFormats
Supports conversion of commands, state variables and events to/from JSON
- Alphabetic
- By Inheritance
- JsonSupport
- MiscJsonFormats
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
implicit
val
booleanFormat: Format[Boolean]
- Definition Classes
- MiscJsonFormats
-
implicit
val
byteFormat: Format[Byte]
- Definition Classes
- MiscJsonFormats
-
implicit
val
charFormat: Format[Char]
- Definition Classes
- MiscJsonFormats
-
implicit
val
characterFormat: Format[Character]
- Definition Classes
- MiscJsonFormats
- implicit val commandFormat: OFormat[Command]
- implicit val controlCommandFormat: Reads[ControlCommand]
-
implicit
val
doubleFormat: Format[Double]
- Definition Classes
- MiscJsonFormats
- implicit val eventFormat: OFormat[Event]
-
implicit
val
floatFormat: Format[Float]
- Definition Classes
- MiscJsonFormats
-
implicit
val
integerFormat: Format[Integer]
- Definition Classes
- MiscJsonFormats
-
implicit
val
longFormat: Format[Long]
- Definition Classes
- MiscJsonFormats
-
implicit
def
optionFormat[T](implicit arg0: Format[T]): Format[Option[T]]
- Definition Classes
- MiscJsonFormats
-
implicit
def
parameterFormat2: Format[Parameter[_]]
- Definition Classes
- MiscJsonFormats
-
def
readEvent[A <: Event](json: JsValue): A
Reads an event back from JSON
Reads an event back from JSON
- A
the type of the event (use Any and match on the type if you don't know)
- json
the parsed JSON
- returns
an instance of the given event type, or an exception if the JSON is not valid for that type
-
def
readResult(json: JsValue): Result
Reads a Result back from JSON
Reads a Result back from JSON
- json
the parsed JSON
- returns
an instance of Result, or an exception if the JSON is not valid for that type
-
def
readSequenceCommand[A <: Command](json: JsValue): A
Reads a SequenceCommand back from JSON
Reads a SequenceCommand back from JSON
- A
the type of the command (implied)
- json
the parsed JSON
- returns
an instance of the given SequenceCommand type, or an exception if the JSON is not valid for that type
-
def
readStateVariable[A <: StateVariable](json: JsValue): A
Reads a StateVariable back from JSON
Reads a StateVariable back from JSON
- A
the type of the StateVariable (implied)
- json
the parsed JSON
- returns
an instance of the given StateVariable, or an exception if the JSON is not valid for that type
- def reads[T](x: JsValue)(implicit arg0: Reads[T]): T
- implicit val sequenceCommandFormat: Reads[SequenceCommand]
-
implicit
val
shortFormat: Format[Short]
- Definition Classes
- MiscJsonFormats
- implicit val stateVariableFormat: OFormat[StateVariable]
-
implicit
val
timestampFormat: Format[Instant]
- Definition Classes
- MiscJsonFormats
-
def
writeEvent[A <: Event](event: A): JsValue
Writes an event to JSON
Writes an event to JSON
- A
the type of the event (implied)
- event
any instance of EventType
- returns
a JsValue object representing the event
-
def
writeResult(result: Result): JsValue
Writes a Result to JSON
Writes a Result to JSON
- result
any instance of Result
- returns
a JsValue object representing the Result
-
def
writeSequenceCommand[A <: Command](result: A): JsValue
Writes a SequenceParameterSet to JSON
Writes a SequenceParameterSet to JSON
- A
the type of the command (implied)
- result
any instance of SequenceCommand
- returns
a JsValue object representing the SequenceCommand
-
def
writeStateVariable[A <: StateVariable](stateVariable: A): JsValue
Writes a state variable to JSON
Writes a state variable to JSON
- A
the type of the StateVariable (implied)
- stateVariable
any instance of StateVariable
- returns
a JsValue object representing the StateVariable
- def writes[T](x: T)(implicit arg0: Writes[T]): JsValue