W3cubDocs

/Haxe

DynamicAccess<T>(Dynamic<T>)

package haxe

from Dynamic<T> to Dynamic<T>

Available on all platforms

DynamicAccess is an abstract type for working with anonymous structures that are intended to hold collections of objects by the string key.

For example, these types of structures are often created from JSON.

Basically, it wraps Reflect calls in a Map-like interface.

Constructor

@:impl inline new ()

Creates a new structure.

Methods

@:impl inline exists (this:Dynamic<T>):Bool

Tells if the structure contains a specified key.

If key is null, the result is unspecified.

@:impl @:arrayAccess inline get (this:Dynamic<T>):Null<T>

Returns a value by specified key.

If the structure does not contain the given key, null is returned.

If key is null, the result is unspecified.

@:impl inline keys ():Array<String>

Returns an array of keys in a structure.

@:impl inline remove (this:Dynamic<T>):Bool

Removes a specified key from the structure.

Returns true, if key was present in structure, or false otherwise.

If key is null, the result is unspecified.

@:impl @:arrayAccess inline set (this:Dynamic<T>, key:String):T

Sets a value for a specified key.

If the structure contains the given key, its value will be overwritten.

Returns the given value.

If key is null, the result is unspecified.

Static methods

@:impl static inline new ()

Creates a new structure.

@:impl static inline exists (this:Dynamic<T>):Bool

Tells if the structure contains a specified key.

If key is null, the result is unspecified.

@:impl @:arrayAccess static inline get (this:Dynamic<T>):Null<T>

Returns a value by specified key.

If the structure does not contain the given key, null is returned.

If key is null, the result is unspecified.

@:impl static inline keys ():Array<String>

Returns an array of keys in a structure.

@:impl static inline remove (this:Dynamic<T>):Bool

Removes a specified key from the structure.

Returns true, if key was present in structure, or false otherwise.

If key is null, the result is unspecified.

@:impl @:arrayAccess static inline set (this:Dynamic<T>, key:String):T

Sets a value for a specified key.

If the structure contains the given key, its value will be overwritten.

Returns the given value.

If key is null, the result is unspecified.

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/haxe/DynamicAccess.html