org.hibernate.search.util.configuration.impl

## Class MaskedProperty

- java.lang.Object
- - java.util.Dictionary<K,V>
  - - java.util.Hashtable<Object,Object>
    - - java.util.Properties
      - - org.hibernate.search.util.configuration.impl.MaskedProperty

- All Implemented Interfaces:
    Serializable, Cloneable, Map<Object,Object>

      public class MaskedProperty
      extends Properties
      implements Serializable

  A wrapper to `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:
  - propertyNames()
  - keySet()
  - keys()
  Other methods including methods returning Entries and values are not supported
  Author:
    Sanne Grinovero, Emmanuel Bernard
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.Properties

      `defaults`

  - ### Constructor Summary

    Constructors
    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.].

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `Object` | `clone()`
    `boolean` | `contains(Object value)`
    `boolean` | `containsKey(Object key)` Check if a given properties is set.
    `boolean` | `containsValue(Object value)`
    `Enumeration<Object>` | `elements()`
    `Set<Map.Entry<Object,Object>>` | `entrySet()`
    `boolean` | `equals(Object obj)`
    `Object` | `get(Object key)`
    `String` | `getProperty(String key)`
    `String` | `getProperty(String key, String defaultValue)`
    `int` | `hashCode()`
    `boolean` | `isEmpty()`
    `Enumeration<Object>` | `keys()`
    `Set<Object>` | `keySet()`
    `void` | `list(PrintStream out)`
    `void` | `list(PrintWriter out)`
    `void` | `load(InputStream inStream)`
    `void` | `loadFromXML(InputStream in)`
    `Enumeration<?>` | `propertyNames()`
    `Object` | `put(Object key, Object value)`
    `void` | `putAll(Map<? extends Object,? extends Object> t)`
    `protected void` | `rehash()`
    `Object` | `remove(Object key)`
    `void` | `save(OutputStream out, String comments)`
    `Object` | `setProperty(String key, String value)`
    `int` | `size()`
    `void` | `store(OutputStream out, String comments)`
    `void` | `storeToXML(OutputStream os, String comment)`
    `void` | `storeToXML(OutputStream os, String comment, String encoding)`
    `String` | `toString()`
    `Collection<Object>` | `values()`

    - ### Methods inherited from class java.util.Properties

      `load, store, stringPropertyNames`

    - ### Methods inherited from class java.util.Hashtable

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MaskedProperty

          public MaskedProperty(Properties propsToMask,
                                String mask)

      Provides a view to the provided Properties hiding all keys not starting with some [mask.].
      Parameters:
        `propsToMask` - the Properties containing the values.
        `mask` - a `String` object.

    - #### MaskedProperty

          public MaskedProperty(Properties propsToMask,
                                String mask,
                                Properties propsFallBack)

      Provides a view to the provided Properties hiding all keys not starting with some [mask.]. If no value is found then a value is returned from propsFallBack, without masking.
      Parameters:
        `propsToMask` - the properties to mask
        `mask` - the mask applied to the properties
        `propsFallBack` - a fall-back map of properties in case a value is not found in the main one

  - ### Method Detail

    - #### getProperty

          public String getProperty(String key)

      Overrides:
        `getProperty` in class `Properties`

    - #### containsKey

          public boolean containsKey(Object key)

      Check if a given properties is set.
      Specified by:
        `containsKey` in interface `Map<Object,Object>`
      Overrides:
        `containsKey` in class `Hashtable<Object,Object>`
      Parameters:
        `key` - the property key
      Returns:
        `true` if the property is set, `false` otherwise
      Throws:
        `IllegalArgumentException` - if the key is not a String instance

    - #### getProperty

          public String getProperty(String key,
                                    String defaultValue)

      Overrides:
        `getProperty` in class `Properties`

    - #### list

          public void list(PrintStream out)

      Overrides:
        `list` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always

    - #### list

          public void list(PrintWriter out)

      Overrides:
        `list` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always

    - #### load

          public void load(InputStream inStream)
                    throws IOException

      Overrides:
        `load` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always
        `IOException`

    - #### loadFromXML

          public void loadFromXML(InputStream in)
                           throws IOException

      Overrides:
        `loadFromXML` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always
        `IOException`

    - #### propertyNames

          public Enumeration<?> propertyNames()

      Overrides:
        `propertyNames` in class `Properties`

    - #### save

          public void save(OutputStream out,
                           String comments)

      Overrides:
        `save` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always

    - #### setProperty

          public Object setProperty(String key,
                                    String value)

      Overrides:
        `setProperty` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always

    - #### store

          public void store(OutputStream out,
                            String comments)
                     throws IOException

      Overrides:
        `store` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always
        `IOException`

    - #### storeToXML

          public void storeToXML(OutputStream os,
                                 String comment,
                                 String encoding)
                          throws IOException

      Overrides:
        `storeToXML` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always
        `IOException`

    - #### storeToXML

          public void storeToXML(OutputStream os,
                                 String comment)
                          throws IOException

      Overrides:
        `storeToXML` in class `Properties`
      Throws:
        `UnsupportedOperationException` - always
        `IOException`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Map<Object,Object>`
      Overrides:
        `clear` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### clone

          public Object clone()

      Overrides:
        `clone` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### contains

          public boolean contains(Object value)

      Overrides:
        `contains` in class `Hashtable<Object,Object>`

    - #### containsValue

          public boolean containsValue(Object value)

      Specified by:
        `containsValue` in interface `Map<Object,Object>`
      Overrides:
        `containsValue` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### elements

          public Enumeration<Object> elements()

      Overrides:
        `elements` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### entrySet

          public Set<Map.Entry<Object,Object>> entrySet()

      Specified by:
        `entrySet` in interface `Map<Object,Object>`
      Overrides:
        `entrySet` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### get

          public Object get(Object key)

      Specified by:
        `get` in interface `Map<Object,Object>`
      Overrides:
        `get` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `Map<Object,Object>`
      Overrides:
        `isEmpty` in class `Hashtable<Object,Object>`

    - #### keys

          public Enumeration<Object> keys()

      Overrides:
        `keys` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### keySet

          public Set<Object> keySet()

      Specified by:
        `keySet` in interface `Map<Object,Object>`
      Overrides:
        `keySet` in class `Hashtable<Object,Object>`

    - #### put

          public Object put(Object key,
                            Object value)

      Specified by:
        `put` in interface `Map<Object,Object>`
      Overrides:
        `put` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### putAll

          public void putAll(Map<? extends Object,? extends Object> t)

      Specified by:
        `putAll` in interface `Map<Object,Object>`
      Overrides:
        `putAll` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### rehash

          protected void rehash()

      Overrides:
        `rehash` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### remove

          public Object remove(Object key)

      Specified by:
        `remove` in interface `Map<Object,Object>`
      Overrides:
        `remove` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### size

          public int size()

      Specified by:
        `size` in interface `Map<Object,Object>`
      Overrides:
        `size` in class `Hashtable<Object,Object>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Hashtable<Object,Object>`

    - #### values

          public Collection<Object> values()

      Specified by:
        `values` in interface `Map<Object,Object>`
      Overrides:
        `values` in class `Hashtable<Object,Object>`
      Throws:
        `UnsupportedOperationException` - always

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Map<Object,Object>`
      Overrides:
        `hashCode` in class `Hashtable<Object,Object>`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in interface `Map<Object,Object>`
      Overrides:
        `equals` in class `Hashtable<Object,Object>`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved