Interface JSONStructure
-
- All Implemented Interfaces:
-
io.kjson.JSONValue
public interface JSONStructure<K extends Object> implements JSONValue
A sealed interface to specify the JSONValue classes that represent structured types (array and object).
-
-
Method Summary
Modifier and Type Method Description abstract JSONValueget(K key)Get the nominated value. abstract BooleanisEmpty()Return trueif the structure is empty.BooleanisNotEmpty()Return trueif the structure is not empty.StringgetString(K key)Get the nominated value os a String, or throw a JSONIncorrectTypeException if it is of the wrong type. LonggetLong(K key)Get the nominated value os a Long, or throw a JSONIncorrectTypeException if it is of the wrong type. IntegergetInt(K key)Get the nominated value os a Int, or throw a JSONIncorrectTypeException if it is of the wrong type. ShortgetShort(K key)Get the nominated value os a Short, or throw a JSONIncorrectTypeException if it is of the wrong type. BytegetByte(K key)Get the nominated value os a Byte, or throw a JSONIncorrectTypeException if it is of the wrong type. ULonggetULong(K key)Get the nominated value os a ULong, or throw a JSONIncorrectTypeException if it is of the wrong type. UIntgetUInt(K key)Get the nominated value os a UInt, or throw a JSONIncorrectTypeException if it is of the wrong type. UShortgetUShort(K key)Get the nominated value os a UShort, or throw a JSONIncorrectTypeException if it is of the wrong type. UBytegetUByte(K key)Get the nominated value os a UByte, or throw a JSONIncorrectTypeException if it is of the wrong type. BigDecimalgetDecimal(K key)Get the nominated value os a BigDecimal, or throw a JSONIncorrectTypeException if it is of the wrong type. BooleangetBoolean(K key)Get the nominated value os a Boolean, or throw a JSONIncorrectTypeException if it is of the wrong type. JSONArraygetArray(K key)Get the nominated value os a JSONArray, or throw a JSONIncorrectTypeException if it is of the wrong type. JSONObjectgetObject(K key)Get the nominated value os a JSONObject, or throw a JSONIncorrectTypeException if it is of the wrong type. abstract IntegergetSize()The size of the structure. -
-
Method Detail
-
isNotEmpty
Boolean isNotEmpty()
Return
trueif the structure is not empty.
-
getString
String getString(K key)
Get the nominated value os a String, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getLong
Long getLong(K key)
Get the nominated value os a Long, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getInt
Integer getInt(K key)
Get the nominated value os a Int, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getShort
Short getShort(K key)
Get the nominated value os a Short, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getByte
Byte getByte(K key)
Get the nominated value os a Byte, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getULong
ULong getULong(K key)
Get the nominated value os a ULong, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getUInt
UInt getUInt(K key)
Get the nominated value os a UInt, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getUShort
UShort getUShort(K key)
Get the nominated value os a UShort, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getUByte
UByte getUByte(K key)
Get the nominated value os a UByte, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getDecimal
BigDecimal getDecimal(K key)
Get the nominated value os a BigDecimal, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getBoolean
Boolean getBoolean(K key)
Get the nominated value os a Boolean, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getArray
JSONArray getArray(K key)
Get the nominated value os a JSONArray, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
getObject
JSONObject getObject(K key)
Get the nominated value os a JSONObject, or throw a JSONIncorrectTypeException if it is of the wrong type.
-
-
-
-