org.omnaest.utils.beans
Class TypeToPropertynameMapAdapter<B>

java.lang.Object
  extended by org.omnaest.utils.structure.map.MapAbstract<String,Object>
      extended by org.omnaest.utils.beans.TypeToPropertynameMapAdapter<B>
Type Parameters:
B -
All Implemented Interfaces:
Map<String,Object>

public class TypeToPropertynameMapAdapter<B>
extends MapAbstract<String,Object>

Adapter to create a Map view on an underlying Java Bean object. Modifications to the bean or the map will be reflected to each other.

Author:
Omnaest
See Also:
MapToTypeAdapter

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  B bean
           
protected  Map<String,BeanPropertyAccessor<B>> propertynameToBeanPropertyAccessorMap
           
 
Constructor Summary
protected TypeToPropertynameMapAdapter(B bean)
           
 
Method Summary
 Object get(Object key)
           
 Set<String> keySet()
           
static
<B> Map<String,Object>
newInstance(B bean)
          Factory method to create a Map view on a given Java Bean object.
 Object put(String key, Object value)
           
 Object remove(Object key)
           
 Collection<Object> values()
           
 
Methods inherited from class org.omnaest.utils.structure.map.MapAbstract
clear, containsKey, containsValue, entrySet, isEmpty, putAll, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

bean

protected B bean

propertynameToBeanPropertyAccessorMap

protected Map<String,BeanPropertyAccessor<B>> propertynameToBeanPropertyAccessorMap
Constructor Detail

TypeToPropertynameMapAdapter

protected TypeToPropertynameMapAdapter(B bean)
Parameters:
bean -
See Also:
newInstance(Object)
Method Detail

newInstance

public static <B> Map<String,Object> newInstance(B bean)
Factory method to create a Map view on a given Java Bean object. Changes to this map will be translated to the Java Bean object and vice versa.

Type Parameters:
B -
Parameters:
bean -
Returns:

get

public Object get(Object key)

put

public Object put(String key,
                  Object value)

remove

public Object remove(Object key)

keySet

public Set<String> keySet()

values

public Collection<Object> values()


Copyright © 2011. All Rights Reserved.