As there is no native support for Maps within Javascript, a simple Map implementation is provided with the Seam Remoting framework. To create a Map which can be used as a parameter to a remote call, create a new Seam.Remoting.Map
object:
var map = new Seam.Remoting.Map();
This Javascript implementation provides basic methods for working with Maps: size()
, isEmpty()
, keySet()
, values()
, get(key)
, put(key, value)
, remove(key)
and contains(key)
. Each of these methods are equivalent to their Java counterpart. Where the method returns a collection, such as keySet()
and values()
, a Javascript Array object will be returned that contains the key or value objects (respectively).