woolpack.utils
クラス MapBuilder<K,V>

java.lang.Object
  上位を拡張 woolpack.utils.MapBuilder<K,V>
型パラメータ:
K - キー。
V - 値。

public class MapBuilder<K,V>
extends java.lang.Object

Mapのビルダ。 コンストラクタツリー内でMapの内容を生成する際に使用する。

作成者:
nakamura

メソッドの概要
 java.util.Map<K,V> get()
          作用対象のMapを返す。
static
<K,V> MapBuilder<K,V>
get(java.util.Map<K,V> map)
          インスタンスを返す。
 MapBuilder<K,V> put(K key)
          作用対象のMapに対しMap.put(Object, Object)を実行する。
 MapBuilder<K,V> put(K key, V value)
          作用対象のMapに対しMap.put(Object, Object)を実行する。
 MapBuilder<K,V> putAll(java.util.Map<K,V> other)
          作用対象のMapに対しMap.putAll(java.util.Map)を実行する。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

get

public static <K,V> MapBuilder<K,V> get(java.util.Map<K,V> map)
インスタンスを返す。

型パラメータ:
K - キー。
V - 値。
パラメータ:
map - 作用対象のMap。本クラスはこの引数の状態を変化させる。
戻り値:
インスタンス。
例外:
java.lang.NullPointerException - 引数が null の場合。

put

public MapBuilder<K,V> put(K key,
                           V value)
作用対象のMapに対しMap.put(Object, Object)を実行する。

パラメータ:
key - キー。
value - 値。
戻り値:
このオブジェクトへの参照。

put

public MapBuilder<K,V> put(K key)
作用対象のMapに対しMap.put(Object, Object)を実行する。 前回実行したput(Object, Object)の値を値として格納する。

パラメータ:
key - キー。
戻り値:
このオブジェクトへの参照。

putAll

public MapBuilder<K,V> putAll(java.util.Map<K,V> other)
作用対象のMapに対しMap.putAll(java.util.Map)を実行する。

パラメータ:
other - 格納されるマッピング。
戻り値:
このオブジェクトへの参照。

get

public java.util.Map<K,V> get()
作用対象のMapを返す。

戻り値:
Map


Copyright (C) 2006 Takahiro Nakamura. All rights reserved.