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 readAltAzCoord(json: JsValue): AltAzCoord
def readCometCoord(json: JsValue): CometCoord
def readEqCoord(json: JsValue): EqCoord
def readEqFrame(json: JsValue): EqFrame
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

def readProperMotion(json: JsValue): ProperMotion
def readResult(json: JsValue): Result

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

def readSequenceCommand[A <: SequenceCommand](json: JsValue): A

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

def readStateVariable[A <: StateVariable](json: JsValue): A

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
def writeAltAzCoord(pm: AltAzCoord): JsValue
def writeCometCoord(pm: CometCoord): JsValue
def writeEqCoord(pm: EqCoord): JsValue
def writeEqFrame(pm: EqFrame): JsValue
def writeEvent(event: Event): JsValue

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

def writeProperMotion(pm: ProperMotion): JsValue
def writeResult(result: Result): JsValue

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

def writeSequenceCommand(result: SequenceCommand): JsValue

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

def writeStateVariable(stateVariable: StateVariable): JsValue

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