@groovy.transform.CompileStatic class LazyBeanMap extends java.lang.Object implements java.util.Map<java.lang.String, java.lang.Object>
A map that backs onto a bean. The map is not initialized from the beans property values on creation, but instead lazily reads the values on demand. No caching is applied, so each read results in a reflective call to retrieve the property. Users of this API should apply their own caching strategy if necessary.
Note that the java.util.Map#values() and java.util.Map#entrySet() implementations are expensive operations as they will read all properties of the target bean and should be used with caution.
Additionally the Map#remove(java.lang.Object) and java.util.Map#clear() methods are not implemented and will throw java.lang.UnsupportedOperationException.
Type | Name and description |
---|---|
java.lang.Object |
target |
Constructor and description |
---|
LazyBeanMap
(java.lang.Object target) Creates a bean map |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
clear() |
|
boolean |
containsKey(java.lang.Object key) |
|
boolean |
containsValue(java.lang.Object value) |
|
java.util.Set<Map.Entry<java.lang.String, java.lang.Object>> |
entrySet() |
|
java.lang.Object |
get(java.lang.Object key) |
|
boolean |
isEmpty() |
|
java.util.Set<java.lang.String> |
keySet() |
|
java.lang.Object |
put(java.lang.String key, java.lang.Object value) |
|
void |
putAll(java.util.Map<? extends java.lang.String, ?> m) |
|
java.lang.Object |
remove(java.lang.Object key) |
|
int |
size() |
|
java.util.Collection<java.lang.Object> |
values() |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates a bean map
target
- The target beanGroovy Documentation