AttributeMap

A map containing the attributes to set on a device.

Constructors

Link copied to clipboard
constructor(jsonAttributes: JSONObject?)

Constructs a new map containing the values described in a JSONObject. Only Number, String, Boolean, and Array types are supported. null values, nested arrays, and unsupported data types will be ignored.

constructor()

Functions

Link copied to clipboard
fun clear()

Removes all elements from this map.

Link copied to clipboard

Returns true if the given key is contained in the map.

Link copied to clipboard
operator fun get(key: String): Any?

Returns the entry with the given key as an object.

Link copied to clipboard
fun getBoolean(key: String, defaultValue: Boolean): Boolean

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

Link copied to clipboard

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard
fun getDate(key: String): Date?

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard
fun getFloat(key: String, defaultValue: Float): Float

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

Link copied to clipboard

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard
fun getInt(key: String, defaultValue: Int): Int

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

Link copied to clipboard

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard

Returns the merge rules for this set of attributes.

Link copied to clipboard
fun getString(key: String): String?

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Link copied to clipboard

Test if mapping is empty.

Link copied to clipboard
fun keySet(): Set<String?>

Returns a Set containing the Strings used as keys in this map.

Link copied to clipboard
fun putBoolean(key: String, value: Boolean)

Inserts a boolean value into this map, replacing any existing value for the given key.

Link copied to clipboard

Inserts a boolean array value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun putDate(key: String, value: Date?)

Inserts a Date value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun putDateArray(key: String, array: ArrayList<Date>?)

Inserts a Date array value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun putFloat(key: String, value: Float)

Inserts a float value into this map, replacing any existing value for the given key.

Link copied to clipboard
fun putFloatArray(key: String, array: ArrayList<Float>?)

Inserts a float array value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun putInt(key: String, value: Int)

Inserts an int value into this map, replacing any existing value for the given key.

Link copied to clipboard
fun putIntArray(key: String, array: ArrayList<Int>?)

Inserts a int array value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun putString(key: String, value: String)

Inserts a String value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard

Inserts a String array value into this map, replacing any existing value for the given key. Value may be null.

Link copied to clipboard
fun remove(key: String)

Removes any entry with the given key from this map.

Link copied to clipboard
fun setMergeRules(mergeRule: MergeRules)

Set the merge rules for the attributes in this map when they are saved to the device.

Link copied to clipboard
fun size(): Int

Returns the number of mappings contained in this map.