View Javadoc
1   package org.dbunit.assertion.comparer.value.builder;
2   
3   import java.util.Collections;
4   import java.util.HashMap;
5   import java.util.Map;
6   
7   import org.dbunit.assertion.comparer.value.ValueComparer;
8   
9   /**
10   * Convenience methods to help build the map of column name ->
11   * {@link ValueComparer}.
12   *
13   * @author jjensen
14   * @since 2.6.0
15   */
16  public class ColumnValueComparerMapBuilder
17  {
18      private Map<String, ValueComparer> comparers =
19              new HashMap<String, ValueComparer>();
20  
21      /**
22       * Add a columnName to {@link ValueComparer} mapping.
23       *
24       * @return this for fluent syntax.
25       */
26      public ColumnValueComparerMapBuilder add(final String columnName,
27              final ValueComparer valueComparer)
28      {
29          comparers.put(columnName, valueComparer);
30          return this;
31      }
32  
33      /** @return The assembled map. */
34      public Map<String, ValueComparer> build()
35      {
36          return Collections.unmodifiableMap(comparers);
37      }
38  }