Type Hierarchy:
Satisfied Interfaces: Category, Cloneable<Map<Key,Item>>, Collection<Key->Item>, Container<Element,Absent>, Correspondence<Object,Item>, Iterable<Element,Null>, Map<Key,Item>, MutableMap<String,String|Boolean|Integer|Float|Object|Array|NullInstance>

Represents a JSON Object

By: Stéphane Épardaud
Initializer
Object({<String->String|Boolean|Integer|Float|Object|Array|NullInstance>*} values= {})
Attributes
cloneSource Code
shared actual Object clone

Obtain a clone of this object. For a mutable object, this should return a copy of the object. For an immutable object, it is acceptable to return the object itself.

Refined declaration: clone
hashSource Code
shared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that if x==y then x.hash==y.hash.

Refined declaration: hash
prettySource Code
shared String pretty

Returns a pretty-printed serialised JSON representation

sizeSource Code
shared actual Integer size
Refined declaration: size
stringSource Code
shared actual String string

Returns a serialised JSON representation

Refined declaration: string
Inherited Attributes
Attributes inherited from: Cloneable<Clone>
clone
Attributes inherited from: Collection<Element>
empty, string
Attributes inherited from: Container<Element,Absent>
empty, first, last
Attributes inherited from: Correspondence<Key,Item>
keys
Attributes inherited from: Iterable<Element,Absent>
coalesced, cycled, indexed, rest, sequence, size, string
Attributes inherited from: Map<Key,Item>
hash, inverse, values
Methods
clearSource Code
shared actual void clear()

Remove every entry from this map, leaving an empty map.

Refined declaration: clear
equalsSource Code
shared actual Boolean equals(Object that)

Determine if two values are equal. Implementations should respect the constraints that:

  • if x===y then x==y (reflexivity),
  • if x==y then y==x (symmetry),
  • if x==y and y==z then x==z (transitivity).

Furthermore it is recommended that implementations ensure that if x==y then x and y have the same concrete class.

Refined declaration: equals
getSource Code
shared actual Null|String|Boolean|Integer|Float|Object|Array|NullInstance get(Object key)

Returns the value defined for the given key, or null if there is no value defined for the given key.

Refined declaration: get
getArraySource Code
shared Array getArray(String key)

Returns an Array value.

Throws:
getArrayOrNullSource Code
shared Array? getArrayOrNull(String key)

Returns an Array value, unless the key does not exist, or the value is null.

Throws:
getBooleanSource Code
shared Boolean getBoolean(String key)

Returns an Boolean value.

Throws:
getBooleanOrNullSource Code
shared Boolean? getBooleanOrNull(String key)

Returns an Boolean value, unless the key does not exist, or the value is null.

Throws:
getFloatSource Code
shared Float getFloat(String key)

Returns an Float value.

Throws:
getFloatOrNullSource Code
shared Float? getFloatOrNull(String key)

Returns an Float value, unless the key does not exist, or the value is null.

Throws:
getIntegerSource Code
shared Integer getInteger(String key)

Returns an Integer value.

Throws:
getIntegerOrNullSource Code
shared Integer? getIntegerOrNull(String key)

Returns an Integer value, unless the key does not exist, or the value is null.

Throws:
getObjectSource Code
shared Object getObject(String key)

Returns an Object value.

Throws:
getObjectOrNullSource Code
shared Object? getObjectOrNull(String key)

Returns an Object value, unless the key does not exist, or the value is null.

Throws:
getStringSource Code
shared String getString(String key)

Returns an String value.

Throws:
getStringOrNullSource Code
shared String? getStringOrNull(String key)

Returns an String value, unless the key does not exist, or the value is null.

Throws:
iteratorSource Code
shared actual Iterator<String->String|Boolean|Integer|Float|Object|Array|NullInstance> iterator()

An iterator for the elements belonging to this container.

Refined declaration: iterator
putSource Code
shared actual Null|String|Boolean|Integer|Float|Object|Array|NullInstance put(String key, String|Boolean|Integer|Float|Object|Array|NullInstance item)

Add an entry to this map, overwriting any existing entry for the given key, and returning the previous value associated with the given key, if any, or null.

Refined declaration: put
putAllSource Code
shared actual void putAll({<String->String|Boolean|Integer|Float|Object|Array|NullInstance>*} entries)

Add the given entries to this map, overwriting any existing entries with the same keys.

Refined declaration: putAll
removeSource Code
shared actual Null|String|Boolean|Integer|Float|Object|Array|NullInstance remove(String key)

Remove the entry associated with the given key, if any, from this map, returning the value no longer associated with the given key, if any, or null.

Refined declaration: remove
Inherited Methods
Methods inherited from: Category
contains, containsAny, containsEvery
Methods inherited from: Collection<Element>
contains
Methods inherited from: Correspondence<Key,Item>
defines, definesAny, definesEvery, get, items
Methods inherited from: Iterable<Element,Absent>
any, by, chain, collect, count, cycle, defaultNullElements, every, filter, find, findLast, fold, following, iterator, longerThan, map, repeat, select, shorterThan, skipping, skippingWhile, sort, taking, takingWhile
Methods inherited from: Map<Key,Item>
equals, mapItems
Methods inherited from: MutableMap<Key,Item>
clear, put, putAll, remove