JsonUtils

org.encalmo.utils.JsonUtils
object JsonUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
JsonUtils.type

Members list

Type members

Classlikes

class MarshallingError(reason: String, source: String) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class UnmarshallingError(reason: String, source: String) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Types

type TransformValue = PartialFunction[Value, Value]

Value members

Concrete methods

def getValueAtPath(pathIterator: Iterator[String], target: Value): Option[Value]

Retrieve some value at json path, or return None.

Retrieve some value at json path, or return None.

Attributes

inline def parsePath(path: String): Iterator[String]
def setValueAtPath(pathIterator: Iterator[String], target: Value, valueToSet: Value, force: Boolean): Unit

Set value at json path. If force=true then add missing path parts.

Set value at json path. If force=true then add missing path parts.

Attributes

def transformValue(pathIterator: Iterator[String], target: Value, transform: PartialFunction[Value, Value], force: Boolean): Unit

Transform value at json path. If force=true then add missing path parts.

Transform value at json path. If force=true then add missing path parts.

Attributes

Extensions

Extensions

extension [L, R](either: Either[L, R])
inline def writeAsJson: Value
inline def writeAsJsonObject: Obj
inline def writeAsString: String
extension [T](entity: T)
inline def writeAsJson: Value
inline def writeAsJsonObject: Obj
inline def writeAsString: String
extension (string: String)
inline def maybeReadAs[T : ReadWriter]: Option[T]
inline def maybeReadAsEither[L : ReadWriter, R : ReadWriter]: Option[Either[L, R]]
inline def maybeReadAsJson: Option[Value]
inline def readAs[T : ReadWriter]: T
inline def readAsEither[L : ReadWriter, R : ReadWriter]: Either[L, R]
inline def readAsJson: Value
extension [T](value: Option[T])
inline def writeAsJsonOrNull: Value
extension (value: Value)
infix def +(field: (String, Value)): Obj
infix def -(key: String): Obj
inline def get(path: String): Option[Value]

Retrieve some value at json path, or return None.

Retrieve some value at json path, or return None.

Attributes

inline def getBoolean(p: String): Boolean
inline def getByPath(path: String): Option[Value]

Retrieve some value at json path, or return None.

Retrieve some value at json path, or return None.

Attributes

inline def getInt(p: String): Int
inline def getString(p: String): String
inline def maybeBoolean(p: String): Option[Boolean]
inline def maybeInt(p: String): Option[Int]
inline def maybeReadAs[T]: Option[T]
inline def maybeReadAsEither[L : ReadWriter, R : ReadWriter]: Option[Either[L, R]]
inline def maybeString(p: String): Option[String]
inline def readAs[T]: T
inline def readAsEither[L : ReadWriter, R : ReadWriter]: Either[L, R]
inline def readByPath[T](path: String): Option[T]

Retrieve some entitty at json path, or return None.

Retrieve some entitty at json path, or return None.

Attributes

inline def remove(path: String): Unit

Remove value at json path, if exists.

Remove value at json path, if exists.

Attributes

inline def set(path: String, string: String): value.type

Set string value at json path, create missing path parts if needed.

Set string value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, number: Int): value.type

Set integer value at json path, create missing path parts if needed.

Set integer value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, number: Double): value.type

Set double value at json path, create missing path parts if needed.

Set double value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, boolean: Boolean): value.type

Set boolean value at json path, create missing path parts if needed.

Set boolean value at json path, create missing path parts if needed.

Attributes

inline def set(path: String, valueToSet: Value, force: Boolean): value.type

Set value at json path. If force=true then create missing path parts.

Set value at json path. If force=true then create missing path parts.

Attributes

inline def setByPath(path: String, valueToSet: Value, force: Boolean): value.type
inline def transform(path: String, transform: TransformValue, force: Boolean): value.type

Transform value at json path. If force=true then create missing path parts.

Transform value at json path. If force=true then create missing path parts.

Attributes

inline def writeByPath[T : ReadWriter](path: String, valueToSet: T, force: Boolean): value.type