ProgramixGenericLib v5.0.1

com.programix.collections
Class MapTools

java.lang.Object
  extended by com.programix.collections.MapTools

public class MapTools
extends Object

Commonly needed utilities for working with the Collections API Map.


Nested Class Summary
static class MapTools.MapException
          Used to indicate that something went wrong in one of the MapTools functions.
 
Method Summary
static Properties generateFrom(File propertiesFile)
           
static Properties generateFrom(InputStream rawIn)
           
static Properties generateFrom(URL propertiesURL)
           
static
<K,V> V
get(Map<K,V> map, K key)
           
static
<K,V> V
get(Map<K,V> map, K key, Class<V> valueType)
           
static
<K> String
getString(Map<K,String> map, K key)
          Used to lookup required String values in a Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static <K,V> V get(Map<K,V> map,
                          K key)
             throws MapTools.MapException
Throws:
MapTools.MapException

get

public static <K,V> V get(Map<K,V> map,
                          K key,
                          Class<V> valueType)
             throws MapTools.MapException
Throws:
MapTools.MapException

getString

public static <K> String getString(Map<K,String> map,
                                   K key)
                        throws MapTools.MapException
Used to lookup required String values in a Map.

Throws:
MapTools.MapException - if the key is not in the map or if the value found can't be cast into a String or either either parameter is null.

generateFrom

public static Properties generateFrom(InputStream rawIn)
                               throws MapTools.MapException
Throws:
MapTools.MapException

generateFrom

public static Properties generateFrom(File propertiesFile)
                               throws MapTools.MapException
Throws:
MapTools.MapException

generateFrom

public static Properties generateFrom(URL propertiesURL)
                               throws MapTools.MapException
Throws:
MapTools.MapException

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.