Project-specific maps storage.

Note: Do not use spaces in any IDs or key names. Entity IDs are shared with other storage IDs.

Constructor

new (srv:Server, p:String, id:Int)

Methods

get (id:String, key:String):Dynamic

Get value from project storage map as an anonymous object.

Parameters:

id

Storage map ID.

key

Storage map key.

Returns:

Storage object.

getInt (id:String, key:String):Int

Get value from project storage map as Int.

Parameters:

id

Storage map ID.

key

Storage map key.

Returns:

Storage value. Returns 0 if key was not found.

getString (id:String, key:String):String

Get value from project storage map as String.

Parameters:

id

Storage map ID.

key

Storage map key.

Returns:

Storage value. Returns an empty string if the key was not found.

has (id:String, key:String):Bool

Check if project storage map has this key.

Parameters:

id

Storage map ID.

key

Storage map key.

Returns:

True is this key exists in storage, false otherwise.

increase (id:String, key:String, ?val:Int):Void

Increase Int value in project storage map.

Parameters:

id

Storage map ID.

key

Storage map key.

val

(optional) Value to increase by.

setInt (id:String, key:String, val:Int, ?flagNX:Bool):Bool

Set Int value in project storage map.

Parameters:

id

Storage map ID.

key

Storage map key.

val

Value.

flagNX

(optional) Will fail if the value exists already.

Returns:

True if the operation was successful, false otherwise.

setObject (id:String, key:String, val:Dynamic):Void

Set object value in project storage map.

Parameters:

id

Storage map ID.

key

Storage map key.

val

Value object. Will be serialized to JSON.

setString (id:String, key:String, val:String):Void

Set String value in project storage map.

Parameters:

id

Storage map ID.

key

Storage map key.

val

Value.

toString ():String

Get list of keys in project storage map.

Parameters:

id

Storage map ID.

Returns:

Array of keys. Returns an empty array if no keys were found.