Package com.gengoai.reflection
Class BeanMap
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.gengoai.reflection.BeanMap
-
public class BeanMap extends AbstractMap<String,Object>
A Map based interface for accessing the properties of a bean object.
Property information is cached using the
BeanDescriptorCache
.- Author:
- David B. Bracewell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object arg0)
boolean
containsValue(Object arg0)
Set<Map.Entry<String,Object>>
entrySet()
Object
get(Object arg0)
Object
getBean()
Set<String>
getSetters()
Type
getType(String key)
Gets the type of the parameter on the setter method.boolean
isEmpty()
Set<String>
keySet()
Object
put(String arg0, Object arg1)
int
size()
Collection<Object>
values()
-
Methods inherited from class java.util.AbstractMap
clear, clone, equals, hashCode, putAll, remove, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
BeanMap
public BeanMap(@NonNull @NonNull Object bean)
Constructs a bean map for a given bean- Parameters:
bean
- The bean
-
-
Method Detail
-
containsKey
public boolean containsKey(Object arg0)
- Specified by:
containsKey
in interfaceMap<String,Object>
- Overrides:
containsKey
in classAbstractMap<String,Object>
-
containsValue
public boolean containsValue(Object arg0)
- Specified by:
containsValue
in interfaceMap<String,Object>
- Overrides:
containsValue
in classAbstractMap<String,Object>
-
getBean
public Object getBean()
- Returns:
- The bean in the bean map
-
getType
public Type getType(String key)
Gets the type of the parameter on the setter method.- Parameters:
key
- The setter method- Returns:
- A
Class
representing the parameter type of the setter method
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
values
public Collection<Object> values()
-
-