Package-level declarations

Types

Link copied to clipboard
abstract class AbstractKpaList<E>(backingList: List<E>) : KpaList

Convenience base class for KpaList implementations backed by a List of native elements of type E.

Link copied to clipboard
abstract class AbstractKpaStructMap<E>(backingMap: Map<String, E>) : KpaStruct

Convenience base class for KpaStruct implementations backed by a Map with String keys and native values of type E.

Link copied to clipboard
interface BackedKpaElement<out B : Any> : KpaElement

Marker interface for KpaElement adapters that wrap a native backing element of type B.

Link copied to clipboard
sealed interface KpaAccessError

Marker for every failure the adapter raises while resolving a pointer against, or mutating, a document.

Link copied to clipboard
sealed interface KpaElement

Common parent of every value type the JSON-Pointer abstraction can address.

Link copied to clipboard

Factory of KpaElement values for a particular backing representation.

Link copied to clipboard
interface KpaList : KpaElement

Read-only view of a list-shaped structure addressable by integer indices.

Link copied to clipboard

DSL scope for applying pointer-based mutations to a KpaList.

Link copied to clipboard
Link copied to clipboard

Represents a leaf value (string, number, boolean, or null) in an adapter-neutral way.

Link copied to clipboard
interface KpaStruct : KpaElement

Read-only view of an object-shaped structure addressable by string keys.

Link copied to clipboard

DSL scope for applying pointer-based mutations to a KpaStruct.

Link copied to clipboard

A mutation used the append token - where it is not permitted (an intermediate position, or a removal).

Link copied to clipboard

A mutation used a segment that is not a non-negative integer to address a list.

Link copied to clipboard

A mutation used a non-negative integer list index that is out of range for the target list.

Link copied to clipboard

A remove mutation targeted a struct key that is not present.

Link copied to clipboard

A mutation targeted the root pointer, which cannot be set or removed.

Link copied to clipboard

A mutation navigated into an intermediate segment that is absent or a primitive, so it is not a container.

Link copied to clipboard

A KpaList that can reconstruct itself after mutation via a KpaElementFactory.

Link copied to clipboard

A KpaStruct that can reconstruct itself after mutation via a KpaElementFactory.

Link copied to clipboard

Resolution used a segment that is not a non-negative integer to address a list.

Link copied to clipboard

Resolution navigated through a primitive intermediate value (a string, number, boolean, or null).

Link copied to clipboard

Trivial implementation of KpaElementFactory creating SimplePrimitive, SimpleStruct, and SimpleList instances.

Link copied to clipboard
class SimpleList(list: ImmutableList<KpaElement>) : RebuildableKpaList

Trivial implementation of RebuildableKpaList backed by an ImmutableList.

Link copied to clipboard
class SimplePrimitive(val value: Any?) : KpaPrimitive

Trivial implementation of KpaPrimitive wrapping a plain value.

Link copied to clipboard
class SimpleStruct(map: ImmutableMap<String, KpaElement>) : RebuildableKpaStruct

Trivial implementation of RebuildableKpaStruct backed by an ImmutableMap.

Link copied to clipboard

Abstract base class for KpaPrimitive implementations that always represent a plain string value.

Functions

Link copied to clipboard

Returns the boolean value at pointer, or null if the path is absent or the value is not a boolean primitive.

Parses path via KPointer.from and returns the boolean value at that path, or null if absent or not a boolean.

Link copied to clipboard

Returns the canonical error-kind string for this KpaAccessError, as used in conformance fixture JSON files.

Link copied to clipboard

Returns the numeric value as Double at pointer, or null if the path is absent or the value is not a numeric primitive.

Parses path via KPointer.from and returns the numeric value as Double at that path, or null if absent or not numeric.

Link copied to clipboard
operator fun KpaList.get(pointer: KPointer): KpaElement?

Returns the KpaElement at the path identified by pointer, or null if the index is out of range — an absent element, consistent with KpaStruct.get returning null for an absent key.

operator fun KpaStruct.get(pointer: KPointer): KpaElement?

Returns the KpaElement at the path identified by pointer, or null if a key along the path is absent. Returns the receiver if pointer is the root pointer.

Link copied to clipboard
fun KpaList.listAt(pointer: KPointer): KpaList?

Returns the KpaList at pointer, or null if the path is absent or the value is not a list.

Parses path via KPointer.from and returns the KpaList at that path, or null if absent or not a list.

Link copied to clipboard
fun KpaList.longAt(pointer: KPointer): Long?
fun KpaStruct.longAt(pointer: KPointer): Long?

Returns the numeric value as Long at pointer, or null if the path is absent, the value is not a numeric primitive, or the value has a fractional component.

fun KpaList.longAt(path: String): Long?

Parses path via KPointer.from and returns the numeric value as Long at that path, or null if absent, not numeric, or has a fractional component.

Link copied to clipboard

Creates a new KpaList by applying pointer-based mutations within block.

Creates a new KpaStruct by applying pointer-based mutations within block.

Link copied to clipboard

Returns the KpaPrimitive at pointer, or null if the path is absent or the value is not a primitive.

Parses path via KPointer.from and returns the KpaPrimitive at that path, or null if absent or not a primitive.

Link copied to clipboard
inline fun <B : Any> KpaElement.requireBacking(libraryName: String): B

Unwraps this KpaElement to its native backing value of type B, or throws if this element is not a BackedKpaElement whose backing is of type B.

Link copied to clipboard

Returns the string value at pointer, or null if the path is absent or the value is not a string primitive.

Parses path via KPointer.from and returns the string value at that path, or null if absent or not a string.

Link copied to clipboard

Returns the KpaStruct at pointer, or null if the path is absent or the value is not a struct.

Parses path via KPointer.from and returns the KpaStruct at that path, or null if absent or not a struct.