org.apache.commons.exec.util
Class MapUtils

java.lang.Object
  extended by org.apache.commons.exec.util.MapUtils

public class MapUtils
extends Object

Helper classes to manipulate maps to pass substition map to the CommandLine. This class is not part of the public API and could change without warning.

Author:
Siegfried Goeschl

Constructor Summary
MapUtils()
           
 
Method Summary
static Map copy(Map source)
          Clones a map.
static Map merge(Map lhs, Map rhs)
          Clones the lhs map and add all things from the rhs map.
static Map prefix(Map source, String prefix)
          Clones a map and prefixes the keys in the clone, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapUtils

public MapUtils()
Method Detail

copy

public static Map copy(Map source)
Clones a map.

Parameters:
source - the source map
Returns:
the clone of the source map

prefix

public static Map prefix(Map source,
                         String prefix)
Clones a map and prefixes the keys in the clone, e.g. for mapping "JAVA_HOME" to "env.JAVA_HOME" to simulate the behaviour of ANT.

Parameters:
source - the source map
prefix - the prefix used for all names
Returns:
the clone of the source map

merge

public static Map merge(Map lhs,
                        Map rhs)
Clones the lhs map and add all things from the rhs map.

Parameters:
lhs - the first map
rhs - the second map
Returns:
the merged map


Copyright © 2011 Apache Software Foundation. All Rights Reserved.