eu.emi.dsr.util
Class PropertyHelper

java.lang.Object
  extended by eu.emi.dsr.util.PropertyHelper

public class PropertyHelper
extends Object

Helper for dealing with groups of properties

Author:
schuller

Constructor Summary
PropertyHelper(Map properties, boolean isRegexp, String... patterns)
          filter the given properties using the supplied patterns
PropertyHelper(Map properties, String... patterns)
          filter the given properties using the supplied patterns
 
Method Summary
 Map<String,String> getFilteredMap()
          gets the properties whose keys match the accepted patterns
 Map<String,String> getFilteredMap(String containedString)
          gets the properties whose keys match the accepted patterns AND whose keys contain the supplied string
 Iterator<String> keys()
          returns an iterator over the valid keys
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHelper

public PropertyHelper(Map properties,
                      String... patterns)
filter the given properties using the supplied patterns


PropertyHelper

public PropertyHelper(Map properties,
                      boolean isRegexp,
                      String... patterns)
filter the given properties using the supplied patterns

Parameters:
properties - - the properties
isRegexp - - whether the patterns denote Java regular expressions
patterns - - the accepted patterns
Method Detail

keys

public Iterator<String> keys()
returns an iterator over the valid keys


getFilteredMap

public Map<String,String> getFilteredMap()
gets the properties whose keys match the accepted patterns

Returns:
a map

getFilteredMap

public Map<String,String> getFilteredMap(String containedString)
gets the properties whose keys match the accepted patterns AND whose keys contain the supplied string

Parameters:
containedString -
Returns:
a map


Copyright © 2012. All Rights Reserved.