org.topbraid.base.util
Class SimpleParameterProvider

java.lang.Object
  extended by org.topbraid.base.util.SimpleParameterProvider
All Implemented Interfaces:
ParameterProvider

public class SimpleParameterProvider
extends Object
implements ParameterProvider

A simple implementation of the ParameterProvider interface, based on a HashMap.

Author:
Holger Knublauch

Constructor Summary
SimpleParameterProvider()
           
SimpleParameterProvider(Map<String,String> map)
           
 
Method Summary
 void add(String key, String value)
          Adds a new entry to the internal Map.
 String getParameter(String key)
          Gets the value of a given parameter.
 Iterator<String> listParameterNames()
          Gets an Iterator over all known parameter names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleParameterProvider

public SimpleParameterProvider()

SimpleParameterProvider

public SimpleParameterProvider(Map<String,String> map)
Method Detail

add

public void add(String key,
                String value)
Adds a new entry to the internal Map. This is typically used in conjunction with the constructor without arguments.

Parameters:
key - the parameter key
value - the value

getParameter

public String getParameter(String key)
Description copied from interface: ParameterProvider
Gets the value of a given parameter. The value "" is a real value, and does not indicate 'not defined'. i.e. if the parameter is missing, this must return null.

Specified by:
getParameter in interface ParameterProvider
Parameters:
key - the parameter
Returns:
the value Is null if the parameter is not defined.

listParameterNames

public Iterator<String> listParameterNames()
Description copied from interface: ParameterProvider
Gets an Iterator over all known parameter names.

Specified by:
listParameterNames in interface ParameterProvider
Returns:
the names


Copyright © 2011 TopQuadrant, Inc.. All Rights Reserved.