Package scriptella.util
Class PropertiesMap
java.lang.Object
scriptella.util.PropertiesMap
Represents a persistent set of properties.
This class is a replacement for Properties class.
Please note that put(String,Object) has additional semantics.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPropertiesMap(int initialCapacity) Creates a properties map from the stream.PropertiesMap(Map<String, ?> props) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()voidload(InputStream is) Loads properties usingProperties.load(java.io.InputStream).Put the property to underlying map.voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
PropertiesMap
public PropertiesMap() -
PropertiesMap
public PropertiesMap(int initialCapacity) -
PropertiesMap
-
PropertiesMap
Creates a properties map from the stream.- Parameters:
is- stream toloadproperties from.- Throws:
IOException- if I/O error occurs- See Also:
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
put
Put the property to underlying map.The properties are immutable, i.e. if the property is already present in the map, the new value is ignored.
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
load
Loads properties usingProperties.load(java.io.InputStream).Properties order is preserved
- Parameters:
is- input stream with properties.- Throws:
IOException- if I/O error occurs.
-
toString
-