public class MapProperties extends Object
| Constructor and Description |
|---|
MapProperties()
Creates an empty properties set
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all properties
|
boolean |
containsKey(String key) |
Object |
get(String key) |
<T> T |
get(String key,
Class<T> clazz)
Returns the object for the given key, casting it to clazz.
|
<T> T |
get(String key,
T defaultValue,
Class<T> clazz)
Returns the object for the given key, casting it to clazz.
|
Iterator<String> |
getKeys() |
Iterator<Object> |
getValues() |
void |
put(String key,
Object value) |
void |
putAll(MapProperties properties) |
void |
remove(String key) |
public boolean containsKey(String key)
key - property namepublic Object get(String key)
key - property namepublic <T> T get(String key, Class<T> clazz)
key - the key of the objectclazz - the class of the objectClassCastException - if the object with the given key is not of type clazzpublic <T> T get(String key, T defaultValue, Class<T> clazz)
key - the key of the objectdefaultValue - the default valueclazz - the class of the objectClassCastException - if the object with the given key is not of type clazzpublic void put(String key, Object value)
key - property namevalue - value to be inserted or modified (if it already existed)public void putAll(MapProperties properties)
properties - set of properties to be addedpublic void remove(String key)
key - property name to be removedpublic void clear()
Copyright © 2021. All rights reserved.