package com.yuchen.saas.park.service.util;

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

/**
 * @Author 任业政
 * @Date 2021/9/6 14:00
 * @Description
 */
public class HashMapChainProxy<K,V> extends HashMap<K,V> {

    public HashMapChainProxy(int initialCapacity) {
        super(initialCapacity);
    }

    public HashMapChainProxy() {
        super();
    }

    public HashMapChainProxy(Map<? extends K, ? extends V> m) {
        super(m);
    }


    public HashMapChainProxy(int initialCapacity, float loadFactor) {
        super(initialCapacity,loadFactor);
    }

    //重写HashMap的所有构造函数---end
    /**
     * 对 HashMap 的 put() 的方法进行封转返回  HashMapProxy 来实现 链式添加
     * @param key
     * @param value
     * @return
     */
    public HashMapChainProxy putObject(K key, V value){
        this.put(key, value);
        return this;
    }
}
