JsonPointer

io.vertx.lang.scala.json.JsonPointer
See theJsonPointer companion object
final case class JsonPointer(internal: JJsonPointer)

Implementation of RFC6901 Json Pointers. This wraps io.vertx.core.json.pointer.JsonPointer and makes it behave more Scala-like.

Value parameters

internal

the wrapped Vert.x io.vertx.core.json.pointer.JsonPointer

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def appended(tokens: String*): JsonPointer

This pointer appended with String tokens.

This pointer appended with String tokens.

Value parameters

tokens

the tokens to append which must not contain escaped characters

Attributes

def appended(index: Int): JsonPointer

This JsonPointer with the given index appended as reference token.

This JsonPointer with the given index appended as reference token.

Note: This function does not mutate this JsonPointer.

Attributes

This JsonPointer with the given other JsonPointer appended.

This JsonPointer with the given other JsonPointer appended.

Note: This function does not mutate this JsonPointer.

Attributes

Return the underlying URI without the fragment

Return the underlying URI without the fragment

Attributes

def isLocalPointer: Boolean

Attributes

Returns

true if the pointer is local (URI with only fragment)

def isParent(child: JsonPointer): Boolean

Attributes

Returns

true if this pointer is a parent of the given child. For instance, "/properties" pointer is parent pointer of "/properties/parent"

def isRootPointer: Boolean

Attributes

Returns

true if the pointer is a root pointer

Evaluates to the parent pointer.

Evaluates to the parent pointer.

Attributes

def query[T : Typeable](jsonObject: JsonObject): Option[T]

Query the given jsonObject, expecting the result to be of type T.

Query the given jsonObject, expecting the result to be of type T.

Note: If this pointer is a root pointer ("") and T is JsonObject, this function returns the provided JSON.

Note: JSON numbers will always result in the Double Scala type. The following JSON to Scala mappings apply:

  • true/false - Boolean

  • number - Double

  • string - String

  • array - JsonArray

  • object - JsonObject

  • null - will always result in None

Type parameters

T

the expected result type of the query

Value parameters

jsonObject

the JSON to query

Attributes

Returns

Some[T] if the requested value exists and has the expected type T, otherwise None

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def toURI: URI

Build a URI representation of the JSON Pointer

Build a URI representation of the JSON Pointer

Attributes

def write[J <: JsonObject | JsonArray : Typeable](json: J, newElement: Any, createIfMissing: Boolean): Option[J]

Write newElement to the given json using this pointer. The path token "-" is handled as append to the end of an array.

Write newElement to the given json using this pointer. The path token "-" is handled as append to the end of an array.

Note: This function does not mutate the given json.

Note: If this is a root pointer, newElement will be returned.

Type parameters

J

either a JsonObject or a JsonArray

Value parameters

createIfMissing

creates a new JsonObject when the parent object key is missing

json

the JSON to write to

newElement

the new element to write

Attributes

Returns

Some[J] if the write was successful, None if not

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product