Class LazyMetaPropertyMap

java.lang.Object
grails.beans.util.LazyMetaPropertyMap
All Implemented Interfaces:
Map

@CompileStatic public class LazyMetaPropertyMap extends Object implements Map
A map implementation that reads an objects properties lazily using Groovy's MetaClass.
  • Constructor Details

    • LazyMetaPropertyMap

      public LazyMetaPropertyMap(Object o)
      Constructs the map
      Parameters:
      o - The object to inspect
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Map
      See Also:
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map
      See Also:
    • containsKey

      public boolean containsKey(Object propertyName)
      Specified by:
      containsKey in interface Map
      See Also:
    • containsValue

      public boolean containsValue(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:
      containsValue in interface Map
      See Also:
    • get

      public Object get(Object propertyName)
      Obtains the value of an object's properties on demand using Groovy's MOP.
      Specified by:
      get in interface Map
      Parameters:
      propertyName - The name of the property
      Returns:
      The property value or null
    • put

      public Object put(Object propertyName, Object propertyValue)
      Specified by:
      put in interface Map
    • remove

      public Object remove(Object o)
      Specified by:
      remove in interface Map
      Throws:
      UnsupportedOperationException
    • putAll

      public void putAll(Map map)
      Specified by:
      putAll in interface Map
    • clear

      public void clear()
      Specified by:
      clear in interface Map
      Throws:
      UnsupportedOperationException
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map
    • values

      public Collection<Object> values()
      Specified by:
      values in interface Map
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map
      Overrides:
      equals in class Object
    • getInstance

      public Object getInstance()
      Returns the wrapped instance.
      Returns:
      The wrapped instance
    • entrySet

      public Set<groovy.util.MapEntry> entrySet()
      Specified by:
      entrySet in interface Map