JsonField

sealed class JsonField<out T : Any>

A class representing a serializable JSON field.

It can either be a KnownValue value of type T, matching the type the SDK expects, or an arbitrary JSON value that bypasses the type system (via JsonValue).

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Deserializer(type: JavaType? = null) : BaseDeserializer<JsonField<*>>
Link copied to clipboard
class IsMissing

This class is a Jackson filter that can be used to exclude missing properties from objects. This filter should not be used directly and should instead use the @ExcludeMissing annotation.

Link copied to clipboard
interface Visitor<in T, out R> : JsonValue.Visitor<R>

An interface that defines how to map each possible state of a JsonField<T> to a value of type R.

Functions

Link copied to clipboard
fun <R> accept(visitor: JsonField.Visitor<T, R>): R

Returns the result of calling the visitor method corresponding to this field's state.

Link copied to clipboard

Returns this field's list value, or null if it doesn't contain a list.

Link copied to clipboard

Returns this field's boolean value, or null if it doesn't contain a boolean.

Link copied to clipboard
fun asKnown(): T?

Returns this field's "known" value, meaning it matches the type the SDK expects, or null if this field contains an arbitrary JsonValue.

Link copied to clipboard

Returns this field's numerical value, or null if it doesn't contain a number.

Link copied to clipboard

Returns this field's map value, or null if it doesn't contain a map.

Link copied to clipboard

Returns this field's string value, or null if it doesn't contain a string.

Link copied to clipboard
Link copied to clipboard

Returns this field's arbitrary JsonValue, meaning it mismatches the type the SDK expects, or null if this field contains a "known" value.

Link copied to clipboard

Returns whether this field is missing, which means it will be omitted from the serialized JSON entirely.

Link copied to clipboard

Whether this field is explicitly set to null.