public class PropertiesMap
extends java.lang.Object
implements java.util.Map<java.lang.String,java.lang.Object>
This class is a replacement for Properties
class.
Please note that put(String,Object)
has additional semantics.
Constructor and Description |
---|
PropertiesMap() |
PropertiesMap(java.io.InputStream is)
Creates a properties map from the stream.
|
PropertiesMap(int initialCapacity) |
PropertiesMap(java.util.Map<java.lang.String,?> props) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
java.lang.Object |
get(java.lang.Object key) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
void |
load(java.io.InputStream is)
Loads properties using
Properties.load(java.io.InputStream) . |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Put the property to underlying map.
|
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t) |
java.lang.Object |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<java.lang.Object> |
values() |
public PropertiesMap()
public PropertiesMap(int initialCapacity)
public PropertiesMap(java.util.Map<java.lang.String,?> props)
public PropertiesMap(java.io.InputStream is) throws java.io.IOException
is
- stream to load
properties from.java.io.IOException
- if I/O error occursload(java.io.InputStream)
public int size()
size
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object put(java.lang.String key, java.lang.Object value)
The properties are immutable, i.e. if the property is already present in the map, the new value is ignored.
put
in interface java.util.Map<java.lang.String,java.lang.Object>
key
- property namevalue
- property valuepublic java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Collection<java.lang.Object> values()
values
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map<java.lang.String,java.lang.Object>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map<java.lang.String,java.lang.Object>
hashCode
in class java.lang.Object
public void load(java.io.InputStream is) throws java.io.IOException
Properties.load(java.io.InputStream)
.
Properties order is preserved
is
- input stream with properties.java.io.IOException
- if I/O error occurs.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © Copyright 2006-2019 The Scriptella Project Team.