public class MaskedProperty extends Properties implements Serializable
Properties
, to restrict the availability of values to only those which have a key
beginning with a given masking string.
Supported methods to enumerate the list of properties are:
defaults
Constructor and Description |
---|
MaskedProperty(Properties propsToMask,
String mask)
Provides a view to the provided Properties hiding
all keys not starting with some [mask.].
|
MaskedProperty(Properties propsToMask,
String mask,
Properties propsFallBack)
Provides a view to the provided Properties hiding all keys not starting with some [mask.].
|
load, store, stringPropertyNames
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public MaskedProperty(Properties propsToMask, String mask)
propsToMask
- the Properties containing the values.mask
- a String
object.public MaskedProperty(Properties propsToMask, String mask, Properties propsFallBack)
propsToMask
- the properties to maskmask
- the mask applied to the propertiespropsFallBack
- a fall-back map of properties in case a value is not found in the main onepublic String getProperty(String key)
getProperty
in class Properties
public boolean containsKey(Object key)
containsKey
in interface Map<Object,Object>
containsKey
in class Hashtable<Object,Object>
key
- the property keytrue
if the property is set, false
otherwiseIllegalArgumentException
- if the key is not a String instancepublic String getProperty(String key, String defaultValue)
getProperty
in class Properties
public void list(PrintStream out)
list
in class Properties
UnsupportedOperationException
- alwayspublic void list(PrintWriter out)
list
in class Properties
UnsupportedOperationException
- alwayspublic void load(InputStream inStream) throws IOException
load
in class Properties
UnsupportedOperationException
- alwaysIOException
public void loadFromXML(InputStream in) throws IOException
loadFromXML
in class Properties
UnsupportedOperationException
- alwaysIOException
public Enumeration<?> propertyNames()
propertyNames
in class Properties
public void save(OutputStream out, String comments)
save
in class Properties
UnsupportedOperationException
- alwayspublic Object setProperty(String key, String value)
setProperty
in class Properties
UnsupportedOperationException
- alwayspublic void store(OutputStream out, String comments) throws IOException
store
in class Properties
UnsupportedOperationException
- alwaysIOException
public void storeToXML(OutputStream os, String comment, String encoding) throws IOException
storeToXML
in class Properties
UnsupportedOperationException
- alwaysIOException
public void storeToXML(OutputStream os, String comment) throws IOException
storeToXML
in class Properties
UnsupportedOperationException
- alwaysIOException
public void clear()
public Object clone()
clone
in class Hashtable<Object,Object>
UnsupportedOperationException
- alwayspublic boolean contains(Object value)
public boolean containsValue(Object value)
containsValue
in interface Map<Object,Object>
containsValue
in class Hashtable<Object,Object>
UnsupportedOperationException
- alwayspublic Enumeration<Object> elements()
elements
in class Hashtable<Object,Object>
UnsupportedOperationException
- alwayspublic boolean isEmpty()
public Enumeration<Object> keys()
keys
in class Hashtable<Object,Object>
UnsupportedOperationException
- alwaysprotected void rehash()
rehash
in class Hashtable<Object,Object>
UnsupportedOperationException
- alwayspublic int size()
public Collection<Object> values()
public int hashCode()
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved