org.omnaest.utils.structure.map
Class MapBuilderOld<K,V>

java.lang.Object
  extended by org.omnaest.utils.structure.map.MapBuilderOld<K,V>
Type Parameters:
K -
V -

Deprecated. use MapUtils.builder() or MapBuilder instead

@Deprecated
public class MapBuilderOld<K,V>
extends Object

Builder for Map instances filled with keys and values.

The MapBuilderOld is not thread safe, since it uses an temporary not thread safe internal Map.
The order of elements is respected when put into the Map. A Map implementation which supports ordering will contain the Map.Entrys in the right order afterwards.

Example:

 Map<String, String> map = new MapBuilder<String, String>().linkedHashMap().put( "key1", "value1" ).put( "key2", "value2" ).build()
 

Author:
Omnaest
See Also:
Map, SortedMap

Nested Class Summary
 class MapBuilderOld.MapBuilderWithMap<M extends Map<K,V>>
          Deprecated. A MapBuilderOld which has a declared Map type and now allows to modify and build a Map
static class MapBuilderOld.MapFactory<K,V>
          Deprecated. Factory for a Map instance
 
Constructor Summary
MapBuilderOld()
          Deprecated.  
 
Method Summary
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> concurrentHashMap()
          Deprecated.  
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> concurrentHashMap(int initialCapacity)
          Deprecated.  
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> hashMap()
          Deprecated.  
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> linkedHashMap()
          Deprecated.  
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> map(Class<? extends Map> mapType, Object... arguments)
          Deprecated. Generic MapBuilderOld instance creator method which creates a MapBuilderOld with a Map instance of the given Class by using reflection.
 MapBuilderOld.MapBuilderWithMap<Map<K,V>> map(MapBuilderOld.MapFactory<K,V> mapFactory)
          Deprecated. MapBuilderOld using a MapBuilderOld.MapFactory to create a Map instance at MapBuilderOld.MapBuilderWithMap.build() time
 MapBuilderOld.MapBuilderWithMap<SortedMap<K,V>> treeMap()
          Deprecated.  
 MapBuilderOld.MapBuilderWithMap<SortedMap<K,V>> treeMap(Comparator<? super K> comparator)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapBuilderOld

public MapBuilderOld()
Deprecated. 
See Also:
MapBuilderOld
Method Detail

hashMap

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> hashMap()
Deprecated. 
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
HashMap

linkedHashMap

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> linkedHashMap()
Deprecated. 
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
LinkedHashMap

concurrentHashMap

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> concurrentHashMap()
Deprecated. 
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
ConcurrentHashMap

concurrentHashMap

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> concurrentHashMap(int initialCapacity)
Deprecated. 
Parameters:
initialCapacity -
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
ConcurrentHashMap

treeMap

public MapBuilderOld.MapBuilderWithMap<SortedMap<K,V>> treeMap()
Deprecated. 
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
TreeMap, SortedMap

treeMap

public MapBuilderOld.MapBuilderWithMap<SortedMap<K,V>> treeMap(Comparator<? super K> comparator)
Deprecated. 
Parameters:
comparator -
Returns:
MapBuilderOld.MapBuilderWithMap
See Also:
TreeMap, SortedMap

map

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> map(MapBuilderOld.MapFactory<K,V> mapFactory)
Deprecated. 
MapBuilderOld using a MapBuilderOld.MapFactory to create a Map instance at MapBuilderOld.MapBuilderWithMap.build() time

Parameters:
mapFactory -
See Also:
MapBuilderOld.MapFactory, MapBuilderOld

map

public MapBuilderOld.MapBuilderWithMap<Map<K,V>> map(Class<? extends Map> mapType,
                                                     Object... arguments)
Deprecated. 
Generic MapBuilderOld instance creator method which creates a MapBuilderOld with a Map instance of the given Class by using reflection. The given Map implementation type has to have a default constructor or a constructor which has the same parameter signature as the additionally given arguments.

Parameters:
mapType -
arguments -
Returns:
MapBuilderOld.MapBuilderWithMap
Throws:
IllegalArgumentException - if no map instance could be created


Copyright © 2013. All Rights Reserved.