package com.hdkj.lt.utils.collection;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: wenhao
 * @Create: 2022/09/20 14:06
 * @Version: 1.0
 */
public class EnhanceMap<K, V> {

    public Builder<K, V> bd;

    public Map<K, V> map() {
        return this.bd.map;
    }

    public static class Builder<K, V> {

        public Map<K, V> map;

        public Builder() {
            this.map = new HashMap<>();
        }

        public Builder(int initialCapacity) {
            this.map = new HashMap<>(initialCapacity);
        }

        public Builder<K, V> put(K k, V v) {
            this.map.put(k, v);
            return this;
        }

        public Builder<K, V> putAll(Map<K, V> allMap) {
            this.map.putAll(allMap);
            return this;
        }

        public void clear() {
            this.map.clear();
        }

    }

}
