Package grails.beans.util
Class LazyMetaPropertyMap
- java.lang.Object
-
- grails.beans.util.LazyMetaPropertyMap
-
- All Implemented Interfaces:
java.util.Map
@CompileStatic public class LazyMetaPropertyMap extends java.lang.Object implements java.util.MapA map implementation that reads an objects properties lazily using Groovy's MetaClass.
-
-
Constructor Summary
Constructors Constructor Description LazyMetaPropertyMap(java.lang.Object o)Constructs the map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object propertyName)booleancontainsValue(java.lang.Object o)Checks whether the specified value is contained within the Map.java.util.Set<groovy.util.MapEntry>entrySet()booleanequals(java.lang.Object o)java.lang.Objectget(java.lang.Object propertyName)Obtains the value of an object's properties on demand using Groovy's MOP.java.lang.ObjectgetInstance()Returns the wrapped instance.inthashCode()booleanisEmpty()java.util.Set<java.lang.String>keySet()java.lang.Objectput(java.lang.Object propertyName, java.lang.Object propertyValue)voidputAll(java.util.Map map)java.lang.Objectremove(java.lang.Object o)intsize()java.util.Collection<java.lang.Object>values()
-
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map- See Also:
Map.size()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map- See Also:
Map.isEmpty()
-
containsKey
public boolean containsKey(java.lang.Object propertyName)
- Specified by:
containsKeyin interfacejava.util.Map- See Also:
Map.containsKey(java.lang.Object)
-
containsValue
public boolean containsValue(java.lang.Object o)
Checks whether the specified value is contained within the Map. Note that because this implementation lazily initialises property values the behaviour may not be consistent with the actual values of the contained object unless they have already been initialised by calling get(Object)- Specified by:
containsValuein interfacejava.util.Map- See Also:
Map.containsValue(Object)
-
get
public java.lang.Object get(java.lang.Object propertyName)
Obtains the value of an object's properties on demand using Groovy's MOP.- Specified by:
getin interfacejava.util.Map- Parameters:
propertyName- The name of the property- Returns:
- The property value or null
-
put
public java.lang.Object put(java.lang.Object propertyName, java.lang.Object propertyValue)- Specified by:
putin interfacejava.util.Map
-
remove
public java.lang.Object remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Map- Throws:
java.lang.UnsupportedOperationException
-
putAll
public void putAll(java.util.Map map)
- Specified by:
putAllin interfacejava.util.Map
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map- Throws:
java.lang.UnsupportedOperationException
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySetin interfacejava.util.Map
-
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
valuesin interfacejava.util.Map
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Map- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Map- Overrides:
equalsin classjava.lang.Object
-
getInstance
public java.lang.Object getInstance()
Returns the wrapped instance.- Returns:
- The wrapped instance
-
entrySet
public java.util.Set<groovy.util.MapEntry> entrySet()
- Specified by:
entrySetin interfacejava.util.Map
-
-