Class ThreadLocalContextImpl

java.lang.Object
icu.easyj.core.context.impls.ThreadLocalContextImpl
All Implemented Interfaces:
Context

@LoadLevel(name="thread-local", order=10) public class ThreadLocalContextImpl extends Object implements Context
存储于 ThreadLocal 的上下文
Author:
wangliang181230
  • Constructor Details

    • ThreadLocalContextImpl

      public ThreadLocalContextImpl()
  • Method Details

    • map

      protected Map<String,Object> map()
    • put

      @Nullable public <V> V put(String key, V value)
      Description copied from interface: Context
      设置值
      Specified by:
      put in interface Context
      Type Parameters:
      V - 上下文数据类型
      Parameters:
      key - 键
      value - 值
      Returns:
      previousValue 返回以前的值 或 null
    • get

      @Nullable public <V> V get(String key)
      Description copied from interface: Context
      获取值
      Specified by:
      get in interface Context
      Type Parameters:
      V - 值类型
      Parameters:
      key - 键
      Returns:
      value 值
    • remove

      @Nullable public <V> V remove(String key)
      Description copied from interface: Context
      移除值
      Specified by:
      remove in interface Context
      Type Parameters:
      V - 值类型
      Parameters:
      key - 键
      Returns:
      removedValue 返回被移除的值 或 null
    • containsKey

      public boolean containsKey(String key)
      Description copied from interface: Context
      是否含有键
      Specified by:
      containsKey in interface Context
      Parameters:
      key - 键
      Returns:
      true=包含 | false=不包含
    • entries

      @NonNull public Map<String,Object> entries()
      Description copied from interface: Context
      获取所有上下文
      Specified by:
      entries in interface Context
      Returns:
      所有上下文
    • clear

      public void clear()
      Description copied from interface: Context
      清空上下文
      Specified by:
      clear in interface Context