程序包 com.sh.util

类 ContextUtil_20200609

java.lang.Object
com.sh.common.util.SHUtils
com.sh.util.ContextUtil_20200609

public class ContextUtil_20200609 extends SHUtils
首亨软件 - CRM、TSS、ERP等信息化管理软件
  • 构造器详细资料

    • ContextUtil_20200609

      public ContextUtil_20200609()
  • 方法详细资料

    • setTimeToLiveSeconds

      public static void setTimeToLiveSeconds(int timeToLiveSeconds)
      设置缓存时长
      参数:
      timeToLiveSeconds - int
    • getTimeToLiveSeconds

      public static int getTimeToLiveSeconds()
      获取生命周期
      返回:
      int
    • setMaxElementsInMemory

      public static void setMaxElementsInMemory(int maxElementsInMemory)
      设置最大缓存数
      参数:
      maxElementsInMemory - 最大允许缓存数
    • getMaxElementsInMemory

      public static int getMaxElementsInMemory()
      获取最大缓存数
      返回:
      int
    • put

      public static void put(String key, Object value, boolean forever)
      添加值到缓存
      参数:
      key - 键
      value - 值
      forever - 是否永久有效
    • containKey

      public static boolean containKey(String key)
      判断是否包含关键字
      参数:
      key - 关键字
      返回:
      boolean
    • put

      public static void put(String key, Object value)
      添加值到缓存
      参数:
      key - 键
      value - 值
    • putRefresh

      public static void putRefresh(String key, Object value)
    • get

      public static Object get(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • remove

      public static void remove(String key)
    • removeReally

      protected static void removeReally(String key)
      删除缓存变量
      参数:
      key - 键
    • removeByStartsKey

      public static void removeByStartsKey(String key)
    • removeByStartsKeyReally

      protected static void removeByStartsKeyReally(String key)
      删除以key开头的缓存
      参数:
      key -
    • clearCache

      public static void clearCache()
    • clearCacheReally

      protected static void clearCacheReally()
      清空所有缓存
    • getString

      public static String getString(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getString2

      public static String getString2(String key)
    • getOptions

      public static Options getOptions(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getCheckBoxGroup

      public static CheckBoxGroup getCheckBoxGroup(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getInteger

      public static Integer getInteger(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getInteger2

      public static int getInteger2(String key)
    • getLong

      public static Long getLong(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getLong2

      public static long getLong2(String key)
    • getDouble

      public static Double getDouble(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getDouble2

      public static double getDouble2(String key)
    • getDatastore

      public static Datastore getDatastore(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getDate

      public static Date getDate(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getTimestamp

      public static Timestamp getTimestamp(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null
    • getThread

      public static Thread getThread(String key)
      通过键获取相应的值
      参数:
      key - 键
      返回:
      获取缓存中的值,没有找到时返回null