JSONNumber

class JSONNumber(val bigDecimal: BigDecimal) : JSONData

A JSONNumber is a JSON number. It provides convenience methods for extracting numeric values in different formats.

Author

Todd L Smith

Constructors

Link copied to clipboard
fun JSONNumber(value: Long)

Construct a new JSONNumber.

Link copied to clipboard
fun JSONNumber(value: Int)

Construct a new JSONNumber.

Link copied to clipboard
fun JSONNumber(value: Double)

Construct a new JSONNumber.

Link copied to clipboard
fun JSONNumber(value: Float)

Construct a new JSONNumber.

Link copied to clipboard
fun JSONNumber(bigDecimal: BigDecimal)

Construct an instance based on a BigDecimal.

Functions

Link copied to clipboard
open override fun writeTo(writer: JSONWriter)

Emit a JSON representation of the receiver onto the specified writer.

Properties

Link copied to clipboard
open override val bigDecimal: BigDecimal

The BigDecimal that encodes this value.

Link copied to clipboard
open override val bigInteger: BigInteger

Get the numeric value as a BigInteger.

Link copied to clipboard
open val boolean: Boolean

Extract a Boolean, or throw a ClassCastException if the value is not a boolean.

Link copied to clipboard
open override val double: Double

Extract a Double.

Link copied to clipboard
open override val float: Float

Extract a Float.

Link copied to clipboard
open override val int: Int

Extract an Int.

Link copied to clipboard
open val isArray: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isBoolean: Boolean

Is the receiver a JSON boolean?

Link copied to clipboard
open val isNull: Boolean

Is the receiver a JSON null?

Link copied to clipboard
open override val isNumber: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isObject: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isString: Boolean

Is the receiver a JSON string?

Link copied to clipboard
open override val long: Long

Extract a Long.

Link copied to clipboard
open val string: String

Extract a String, or throw a ClassCastException if the value is not a string.