public class RpcMap extends Object implements Serializable
The GWT RPC rebinder generates field serializers for every type that is assignable to any type in the RPC interfaces.
If BaseModel was to use "Map<String, Serializable> map" this would trigger the RPC system to generate field serializers for EVERY Serializable type in your GWT Module's class path. Therefore BaseModel uses "Map<String, RpcField> map" and relies on type erasure (cast to Map<Object,Object>) to work around this. The only drawback is that if you have to ensure that field serializers are generated for any type you add to this map. RpcMap ensures that the following types are supported Byte, Short, Integer, Long, Float, Double, Date, Boolean, and arrays of these types. As well as List, Set and MapConstructor and Description |
---|
RpcMap() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all the mappings from this map.
|
boolean |
containsKey(String key)
Returns true if this map contains a mapping for this key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.
|
Set<Map.Entry<String,Object>> |
entrySet()
Returns a Set view of the mappings contained in this map.
|
boolean |
equals(Object o) |
Object |
get(String key)
Returns the value to which the specified key is mapped, or null if this map
contains no mapping for the key.
|
Map<String,Object> |
getTransientMap()
Returns the internal map.
|
int |
hashCode() |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set<String> |
keySet()
Returns a Set view of the keys contained in this map.
|
Object |
put(String key,
Object value)
Associates the specified value with the specified key in this map (optional
operation).
|
void |
putAll(Map<? extends String,? extends Object> m)
Copies all of the mappings from the specified map to this map (optional
operation).
|
Object |
remove(Object key)
Removes the mapping for a key from this map if it is present (optional
operation).
|
int |
size()
Returns the number of key-value mappings in this map.
|
String |
toString() |
Collection<Object> |
values()
Returns a Collection view of the values contained in this map.
|
public Map<String,Object> getTransientMap()
public void clear()
public boolean containsKey(String key)
key
- the keypublic boolean containsValue(Object value)
value
- the valuepublic Set<Map.Entry<String,Object>> entrySet()
public Object get(String key)
key
- the keypublic boolean isEmpty()
public Set<String> keySet()
public Object put(String key, Object value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keypublic void putAll(Map<? extends String,? extends Object> m)
m
- mappings to be stored in this mappublic Object remove(Object key)
key
- key whose mapping is to be removed from the mappublic int size()
public Collection<Object> values()
Copyright © 2015. All rights reserved.