getBigDecimal

fun getBigDecimal(index: Int, orElse: () -> BigDecimal = { throw NullPointerException( "Value at index, $index, was `null` when trying to read a " + "BigDecimal.") }): BigDecimal

Get a BigDecimal at the requested subscript.

Return

The BigDecimal at the requested subscript, or the result of applying orElse if the element was null.

Parameters

index

The array subscript.

orElse

An optional function to run if the element was null. If not present, a NullPointerException is thrown if the element was null.

Throws

If the subscript is out of bounds.

If the requested element is null and orElse was omitted.

If the element at the requested subscript is not a JSONValue.