public class Parameters extends Object
RaftProperties is that
RaftProperties is String based, i.e. properties are strings,
while this class is Object based, i.e. parameters can be any objects.
Null keys or null values are not supported.
This class is thread safe.| Constructor and Description |
|---|
Parameters() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String key,
Class<T> valueClass) |
<T> T |
getNonNull(String key,
Class<T> valueClass)
The same as
get(String, Class) except that this method throws
a NullPointerException if the key does not map to any value. |
<T> T |
put(String key,
T value,
Class<T> valueClass)
Put the key-value pair to the map.
|
public <T> T get(String key, Class<T> valueClass)
T - The value type.IllegalArgumentException - if the mapped value is not an instance of the given class.public <T> T getNonNull(String key, Class<T> valueClass)
get(String, Class) except that this method throws
a NullPointerException if the key does not map to any value.Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.