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

Constructor Summary
MapBuilder()
           
 
Method Summary
 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.
 java.util.HashMap toHashMap()
          Return a set build from the collection.
 java.util.LinkedHashMap toLinkedHashMap()
          Return a list build from the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapBuilder

public MapBuilder()
Method Detail

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

toHashMap

public java.util.HashMap toHashMap()
Return a set build from the collection.

Returns:
a set

toLinkedHashMap

public java.util.LinkedHashMap toLinkedHashMap()
Return a list build from the collection.

Returns:
a list