|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValueMap
The ValueMap
is an easy way to access properties of a resource.
With most resources you can use Adaptable.adaptTo(Class)
to adapt the
resource to a value map. The various getter methods can be used to get the
properties of the resource.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
static ValueMap |
EMPTY
Empty value map |
Method Summary | ||
---|---|---|
|
get(java.lang.String name,
java.lang.Class<T> type)
Get a named property and convert it into the given type. |
|
|
get(java.lang.String name,
T defaultValue)
Get a named property and convert it into the given type. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail |
---|
static final ValueMap EMPTY
Method Detail |
---|
<T> T get(java.lang.String name, java.lang.Class<T> type)
name
- The name of the propertytype
- The class of the type
null
if
non existing or can't be converted.<T> T get(java.lang.String name, T defaultValue)
name
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing propert is
not converted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |