All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.featherfly.common.structure.ThreadLocalMap Maven / Gradle / Ivy


package cn.featherfly.common.structure;

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

/**
 * 

* ThreadLocalMap *

* . * * @author zhongj * @param the key type * @param the value type */ public class ThreadLocalMap extends ThreadLocal> { /** * Put value with key. * * @param key the key * @param value the value * @return the thread local map */ public ThreadLocalMap put(K key, V value) { get().put(key, value); return this; } /** * Gets the key of value. * * @param key the key * @return the v */ public V get(K key) { return get().get(key); } /** * Removes the key. * * @param key the key * @return the thread local map */ public ThreadLocalMap remove(K key) { get().remove(key); return this; } /** * {@inheritDoc} */ @Override protected Map initialValue() { return new HashMap<>(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy