Package com.saperion.util.configuration
Class CaseInsensitiveProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- com.saperion.util.configuration.CaseInsensitiveProperties
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
public class CaseInsensitiveProperties extends java.util.Properties
A case-insensitive properties class. All strings will be converted to upper-case when a new property is added or when a property is retrieved. Note that the keys prop1 and Prop1 will be treated as equal.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveProperties(java.util.Properties properties)
Creates a new case-insensitive properties instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getProperty(java.lang.String key)
java.lang.String
getProperty(java.lang.String key, java.lang.String defaultValue)
java.lang.Object
put(java.lang.Object key, java.lang.Object value)
Adds a new entry to the underlying map.void
putAll(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> t)
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Constructor Detail
-
CaseInsensitiveProperties
public CaseInsensitiveProperties(java.util.Properties properties)
Creates a new case-insensitive properties instance. The entries in the specified properties instance will be copied to the new instance with their keys converted to upper-case. Note that by doing this, properties might get overwritten if the specified properties instance contains keys that differ only in upper-/lowercase.- Parameters:
properties
- set of properties to copy
-
-
Method Detail
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
Adds a new entry to the underlying map. If the key is of type string, it will be converted to upper-case.- Specified by:
put
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
put
in classjava.util.Properties
- Parameters:
key
- the key of the new entryvalue
- the value of the new entry- See Also:
Hashtable.put(java.lang.Object, java.lang.Object)
-
putAll
public void putAll(java.util.Map<? extends java.lang.Object,? extends java.lang.Object> t)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
putAll
in classjava.util.Properties
- See Also:
Hashtable.putAll(java.util.Map)
-
getProperty
public java.lang.String getProperty(java.lang.String key)
- Overrides:
getProperty
in classjava.util.Properties
- See Also:
Properties.getProperty(java.lang.String)
-
getProperty
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
- Overrides:
getProperty
in classjava.util.Properties
- See Also:
Properties.getProperty(java.lang.String, java.lang.String)
-
-