public class Properties extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
properties |
| Constructor and Description |
|---|
Properties() |
Properties(Map<String,Object> properties) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addListItem(PropertyListKey<T> property,
T value)
Append the value to the list to which the specified property key is mapped.
|
boolean |
contains(PropertyKey<?> property)
Returns
true if this properties contains a mapping for the specified property key. |
boolean |
contains(PropertyListKey<?> property)
Returns
true if this properties contains a mapping for the specified property key. |
boolean |
contains(PropertyMapKey<?,?> property)
Returns
true if this properties contains a mapping for the specified property key. |
<T> T |
get(PropertyKey<T> property)
Returns the value to which the specified property key is mapped, or
null if this properties contains no mapping for the property key. |
<T> List<T> |
get(PropertyListKey<T> property)
Returns the list to which the specified property key is mapped, or
an empty list if this properties contains no mapping for the property key.
|
<K,V> Map<K,V> |
get(PropertyMapKey<K,V> property)
Returns the map to which the specified property key is mapped, or
an empty map if this properties contains no mapping for the property key.
|
<K,V> void |
putMapEntry(PropertyMapKey<K,V> property,
K key,
V value)
Insert the value to the map to which the specified property key is mapped.
|
<T> void |
set(PropertyKey<T> property,
T value)
Associates the specified value with the specified property key.
|
<T> void |
set(PropertyListKey<T> property,
List<T> value)
Associates the specified list with the specified property key.
|
<K,V> void |
set(PropertyMapKey<K,V> property,
Map<K,V> value)
Associates the specified map with the specified property key.
|
Map<String,Object> |
toMap()
Returns a map view of this properties.
|
String |
toString() |
public <T> T get(PropertyKey<T> property)
null if this properties contains no mapping for the property key.property - the property key whose associated value is to be returnednull if this properties contains no mapping for the property keypublic <T> List<T> get(PropertyListKey<T> property)
property - the property key whose associated list is to be returnedaddListItem(PropertyListKey, Object)public <K,V> Map<K,V> get(PropertyMapKey<K,V> property)
property - the property key whose associated map is to be returnedputMapEntry(PropertyMapKey, Object, Object)public <T> void set(PropertyKey<T> property, T value)
T - the type of the valueproperty - the property key with which the specified value is to be associatedvalue - the value to be associated with the specified property keypublic <T> void set(PropertyListKey<T> property, List<T> value)
T - the type of elements in the listproperty - the property key with which the specified list is to be associatedvalue - the list to be associated with the specified property keypublic <K,V> void set(PropertyMapKey<K,V> property, Map<K,V> value)
K - the type of keys maintained by the mapV - the type of mapped valuesproperty - the property key with which the specified map is to be associatedvalue - the map to be associated with the specified property keypublic <T> void addListItem(PropertyListKey<T> property, T value)
T - the type of elements in the listproperty - the property key whose associated list is to be addedvalue - the value to be appended to listpublic <K,V> void putMapEntry(PropertyMapKey<K,V> property, K key, V value)
K - the type of keys maintained by the mapV - the type of mapped valuesproperty - the property key whose associated list is to be addedvalue - the value to be appended to listpublic boolean contains(PropertyKey<?> property)
true if this properties contains a mapping for the specified property key.property - the property key whose presence is to be testedtrue if this properties contains a mapping for the specified property keypublic boolean contains(PropertyListKey<?> property)
true if this properties contains a mapping for the specified property key.property - the property key whose presence is to be testedtrue if this properties contains a mapping for the specified property keypublic boolean contains(PropertyMapKey<?,?> property)
true if this properties contains a mapping for the specified property key.property - the property key whose presence is to be testedtrue if this properties contains a mapping for the specified property keypublic Map<String,Object> toMap()
Copyright © 2022. All rights reserved.