Package org.pentaho.di.core
Class ConcurrentMapProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- org.pentaho.di.core.ConcurrentMapProperties
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,Object>
public class ConcurrentMapProperties extends Properties
Thread Safe version of Java Properties class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentMap<Object,Object>
storageMap
-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description ConcurrentMapProperties()
ConcurrentMapProperties(Properties defaults)
-
Method Summary
-
Methods inherited from class java.util.Properties
rehash, storeToXML
-
-
-
-
Field Detail
-
storageMap
protected ConcurrentMap<Object,Object> storageMap
-
-
Constructor Detail
-
ConcurrentMapProperties
public ConcurrentMapProperties()
-
ConcurrentMapProperties
public ConcurrentMapProperties(Properties defaults)
-
-
Method Detail
-
clear
public void clear()
-
clone
public Object clone()
- Overrides:
clone
in classProperties
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<Object,Object>
- Overrides:
containsValue
in classProperties
-
compute
public Object compute(Object key, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)
-
computeIfAbsent
public Object computeIfAbsent(Object key, Function<? super Object,? extends Object> mappingFunction)
- Specified by:
computeIfAbsent
in interfaceMap<Object,Object>
- Overrides:
computeIfAbsent
in classProperties
-
computeIfPresent
public Object computeIfPresent(Object key, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)
- Specified by:
computeIfPresent
in interfaceMap<Object,Object>
- Overrides:
computeIfPresent
in classProperties
-
contains
public boolean contains(Object value)
- Overrides:
contains
in classProperties
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<Object,Object>
- Overrides:
containsKey
in classProperties
-
elements
public Enumeration<Object> elements()
- Overrides:
elements
in classProperties
-
forEach
public void forEach(BiConsumer<? super Object,? super Object> action)
-
getOrDefault
public Object getOrDefault(Object key, Object defaultValue)
- Specified by:
getOrDefault
in interfaceMap<Object,Object>
- Overrides:
getOrDefault
in classProperties
-
keys
public Enumeration<Object> keys()
- Overrides:
keys
in classProperties
-
merge
public Object merge(Object key, Object value, BiFunction<? super Object,? super Object,? extends Object> remappingFunction)
-
putIfAbsent
public Object putIfAbsent(Object key, Object value)
- Specified by:
putIfAbsent
in interfaceMap<Object,Object>
- Overrides:
putIfAbsent
in classProperties
-
replaceAll
public void replaceAll(BiFunction<? super Object,? super Object,? extends Object> function)
- Specified by:
replaceAll
in interfaceMap<Object,Object>
- Overrides:
replaceAll
in classProperties
-
values
public Collection<Object> values()
-
getProperty
public String getProperty(String key)
- Overrides:
getProperty
in classProperties
-
getProperty
public String getProperty(String key, String defaultValue)
- Overrides:
getProperty
in classProperties
-
setProperty
public Object setProperty(String key, String value)
- Overrides:
setProperty
in classProperties
-
equals
public boolean equals(Object o)
-
toString
public String toString()
- Overrides:
toString
in classProperties
-
hashCode
public int hashCode()
-
propertyNames
public Enumeration<?> propertyNames()
- Overrides:
propertyNames
in classProperties
-
stringPropertyNames
public Set<String> stringPropertyNames()
- Overrides:
stringPropertyNames
in classProperties
-
list
public void list(PrintStream out)
- Overrides:
list
in classProperties
-
list
public void list(PrintWriter out)
- Overrides:
list
in classProperties
-
load
public void load(InputStream inStream) throws IOException
- Overrides:
load
in classProperties
- Throws:
IOException
-
load
public void load(Reader reader) throws IOException
- Overrides:
load
in classProperties
- Throws:
IOException
-
loadFromXML
public void loadFromXML(InputStream in) throws IOException, InvalidPropertiesFormatException
- Overrides:
loadFromXML
in classProperties
- Throws:
IOException
InvalidPropertiesFormatException
-
save
@Deprecated public void save(OutputStream out, String comments)
Deprecated.- Overrides:
save
in classProperties
-
store
public void store(OutputStream out, String comments) throws IOException
- Overrides:
store
in classProperties
- Throws:
IOException
-
store
public void store(Writer writer, String comments) throws IOException
- Overrides:
store
in classProperties
- Throws:
IOException
-
storeToXML
public void storeToXML(OutputStream os, String comment) throws IOException
- Overrides:
storeToXML
in classProperties
- Throws:
IOException
-
storeToXML
public void storeToXML(OutputStream os, String comment, String encoding) throws IOException
- Overrides:
storeToXML
in classProperties
- Throws:
IOException
-
convertProperties
public static ConcurrentMapProperties convertProperties(Properties props)
Converts a Properties object to a ConcurrentMapProperties object- Parameters:
props
-- Returns:
- A new ConcurrentMapProperties with all properties enumerated (including defaults)
-
-