ProblemPrimitive

A scalar extension value: a string, a number, or a boolean.

The wire literal stays verbatim instead of getting parsed into a Kotlin type. That is what lets a number survive both codecs byte for byte: 1.50 gets written back as 1.50, not 1.5.

Properties

Link copied to clipboard

The scalar parsed as a Boolean.

Link copied to clipboard

The scalar parsed as a Boolean, or null if this value is not a scalar or is not true/false.

Link copied to clipboard

the literal exactly as it appears on the wire, with the quotes of a JSON string already removed.

Link copied to clipboard

The scalar parsed as a Double. Reads the wire literal, so a quoted "1.5" also returns 1.5.

Link copied to clipboard

The scalar parsed as a Double, or null if this value is not a scalar or does not parse.

Link copied to clipboard

The scalar parsed as an Int.

Link copied to clipboard

The scalar parsed as an Int, or null if this value is not a scalar or does not parse.

Link copied to clipboard

whether the value must be written as a quoted string. content is 30 for both the string "30" and the number 30; this flag is the only thing telling them apart.

Link copied to clipboard

The scalar parsed as a Long. Reads the wire literal, so a quoted "30" also returns 30.

Link copied to clipboard

The scalar parsed as a Long, or null if this value is not a scalar or does not parse.

Link copied to clipboard

This value as a scalar.

Link copied to clipboard

This value as a scalar, or null if it is an array, an object or ProblemNull.

Link copied to clipboard

This value as an array.

Link copied to clipboard

This value as an array, or null if it is anything else.

Link copied to clipboard

This value as an object.

Link copied to clipboard

This value as an object, or null if it is anything else.

Link copied to clipboard

The scalar's wire literal as text, with the quotes of a JSON string already removed.

Link copied to clipboard

The scalar's wire literal as text, or null if this value is not a scalar.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Two primitives are equal when the literal and the string flag both match. That keeps the string "30" and the number 30 apart, even though both share a ProblemPrimitive.content of 30.

Link copied to clipboard
open override fun hashCode(): Int

Derived from both properties, consistently with equals.

Link copied to clipboard
open override fun toString(): String

The value as it would be written to a JSON document, quoted when ProblemPrimitive.isString.