org.cert.cc.beans
Class BeanMap

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by org.cert.cc.beans.BeanMap
All Implemented Interfaces:
Map<String,Object>

public class BeanMap
extends AbstractMap<String,Object>

Gives a deep Map view on an underlying bean

© 2011 Carnegie Mellon University

Author:
Aaron Reffett

Nested Class Summary
static interface BeanMap.BeanMediator
          Mediates access between the bean map and its delegate bean
static class BeanMap.DefaultBeanMediator
          Mediator that uses bean introspection and property descriptors to provide access to the bean
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
BeanMap(Object bean)
          Creates a bean map backed by the given bean
BeanMap(Object bean, BeanMap.BeanMediator mediator)
          Creates a bean map backed by the given bean and accessed by the given bean mediator
 
Method Summary
 Set<Map.Entry<String,Object>> entrySet()
           
 boolean equals(Object o)
          Delegates to the underlying bean
 int hashCode()
          Delegates to the underlying bean
 String toString()
          Returns the underlying object's toString value
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanMap

public BeanMap(Object bean)
Creates a bean map backed by the given bean

Parameters:
bean -

BeanMap

public BeanMap(Object bean,
               BeanMap.BeanMediator mediator)
Creates a bean map backed by the given bean and accessed by the given bean mediator

Parameters:
bean -
mediator -
Method Detail

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>
Specified by:
entrySet in class AbstractMap<String,Object>
See Also:
AbstractMap.entrySet()

toString

public String toString()
Returns the underlying object's toString value

Overrides:
toString in class AbstractMap<String,Object>
See Also:
AbstractMap.toString()

equals

public boolean equals(Object o)
Delegates to the underlying bean

Specified by:
equals in interface Map<String,Object>
Overrides:
equals in class AbstractMap<String,Object>
See Also:
AbstractMap.equals(java.lang.Object)

hashCode

public int hashCode()
Delegates to the underlying bean

Specified by:
hashCode in interface Map<String,Object>
Overrides:
hashCode in class AbstractMap<String,Object>
See Also:
AbstractMap.hashCode()


Copyright © 2012 Carnegie Mellon University