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

java.lang.Object
  extended by org.omnaest.utils.structure.map.MapAbstract<String,Object>
      extended by org.omnaest.utils.beans.adapter.TypeToPropertynameMapAdapter<B>
Type Parameters:
B -
All Implemented Interfaces:
Serializable, 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:
PropertynameMapToTypeAdapter, Serialized Form

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, PropertyAccessOption propertyAccessOption)
           
 
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.
static
<B> Map<String,Object>
newInstance(B bean, PropertyAccessOption propertyAccessOption)
           
 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,
                                       PropertyAccessOption propertyAccessOption)
Parameters:
bean -
propertyAccessOption - PropertyAccessOption
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:

newInstance

public static <B> Map<String,Object> newInstance(B bean,
                                                 PropertyAccessOption propertyAccessOption)
Type Parameters:
B -
Parameters:
bean -
propertyAccessOption -
Returns:
See Also:
PropertyAccessOption, newInstance(Object)

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 © 2013. All Rights Reserved.