com.namics.oss.java.tools.utils.maps.MapBuilder Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2000-2014 Namics AG. All rights reserved.
*/
package com.namics.oss.java.tools.utils.maps;
import java.util.*;
/**
* Helper to bu@ild maps with builder Pattern.
*
* @param Type of keys to be used in map to be build
* @param Type of values to be used in map to be build
* @author aschaefer, Namics AG
* @since 13.06.14 10:40
*/
public class MapBuilder {
protected Map target;
/**
* Create a builder with a default map implementation.
*/
public MapBuilder() {
this.target = new HashMap();
}
/**
* Create a builder to populate an existing Map instances.
* The provided map will be modified!
*
* @param target Map Instance to be populated.
*/
public MapBuilder(Map target) {
this.target = target;
}
/**
* Create a builder to create a map of the provided type.
*
* @param clazz Type of Map to be created with this builder.
* @param