| Constructor and Description |
|---|
Properties() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Properties<K,V> |
copy() |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object obj) |
static <K,V> Properties<K,V> |
from(Map<? extends K,? extends V> map) |
<T> T |
get(Class<T> targetClass,
Object propName)
To avoid
NullPointerException for primitive type if the target property is null or not set. |
V |
get(Object propName) |
<T> T |
getOrDefault(Class<T> targetClass,
Object propName,
T defaultValue)
Gets the or default.
|
V |
getOrDefault(Object propName,
V defaultValue)
Gets the or default.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if is empty.
|
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
putIfAbsent(K key,
V value)
Put if absent.
|
V |
remove(Object key) |
boolean |
remove(Object key,
Object value)
Removes the entry for the specified key only if it is currently
mapped to the specified value.
|
V |
replace(K key,
V value)
Replaces the entry for the specified key only if it is
currently mapped to some value.
|
boolean |
replace(K key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently
mapped to the specified value.
|
Properties<K,V> |
set(K propName,
V propValue) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
compute, computeIfAbsent, computeIfPresent, forEach, merge, replaceAllpublic static <K,V> Properties<K,V> from(Map<? extends K,? extends V> map)
K - the key typeV - the value typemap - public <T> T get(Class<T> targetClass, Object propName)
NullPointerException for primitive type if the target property is null or not set.T - targetClass - propName - public V getOrDefault(Object propName, V defaultValue)
getOrDefault in interface Map<K,V>propName - is returned if the specified propName is not contained in this Properties instance or it's
null.public <T> T getOrDefault(Class<T> targetClass, Object propName, T defaultValue)
T - targetClass - propName - is returned if the specified propName is not contained in this Properties instance or it's null.public Properties<K,V> set(K propName, V propValue)
propName - propValue - public V putIfAbsent(K key, V value)
putIfAbsent in interface Map<K,V>key - value - public boolean remove(Object key, Object value)
public V replace(K key, V value)
public boolean replace(K key, V oldValue, V newValue)
public boolean containsKey(Object key)
containsKey in interface Map<K,V>key - public boolean containsValue(Object value)
containsValue in interface Map<K,V>value - public boolean isEmpty()
public Properties<K,V> copy()
public int hashCode()
public boolean equals(Object obj)
Copyright © 2021. All rights reserved.