org.jboss.portal.common.util
Class MapBuilder

java.lang.Object
  extended by org.jboss.portal.common.util.MapBuilder

public class MapBuilder
extends java.lang.Object

An helper to build collection of object in a simple manner.

Version:
$Revision: 7228 $
Author:
Julien Viet

Method Summary
static MapBuilder create(java.util.Map map)
           
 java.util.Map get()
           
static MapBuilder hashMap()
          Creates a new instance.
static MapBuilder linkedHashMap()
          Creates a new instance.
 MapBuilder put(java.lang.Object key, java.lang.Object value)
          Add the object to the collection.
 MapBuilder putAll(java.util.Map all)
          Add all the objects to the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashMap

public static MapBuilder hashMap()
Creates a new instance.

Returns:
a new instance

linkedHashMap

public static MapBuilder linkedHashMap()
Creates a new instance.

Returns:
a new instance

create

public static MapBuilder create(java.util.Map map)

put

public MapBuilder put(java.lang.Object key,
                      java.lang.Object value)
Add the object to the collection.

Parameters:
key - the key
value - the value
Returns:
the builder

putAll

public MapBuilder putAll(java.util.Map all)
Add all the objects to the collection.

Parameters:
all - the entries to add
Returns:
the builder

get

public java.util.Map get()