Interface SaSetValueInterface

All Superinterfaces:
SaGetValueInterface
All Known Subinterfaces:
SaStorage
All Known Implementing Classes:
SaApplication, SaSession, SaStorageForMock

public interface SaSetValueInterface extends SaGetValueInterface
对写值的一组方法封装

封装 SaStorage、SaSession、SaApplication 等存取值的一些固定方法,减少重复编码

Since:
1.31.0
Author:
click33
  • Method Details

    • set

      SaSetValueInterface set(String key, Object value)
      写值
      Parameters:
      key - 名称
      value - 值
      Returns:
      对象自身
    • delete

      删值
      Parameters:
      key - 要删除的key
      Returns:
      对象自身
    • get

      default <T> T get(String key, SaRetGenericFunction<T> fun)
      取值 (如果值为 null,则执行 fun 函数获取值,并把函数返回值写入缓存)
      Type Parameters:
      T - 返回值的类型
      Parameters:
      key - key
      fun - 值为null时执行的函数
      Returns:
    • setByNull

      default SaSetValueInterface setByNull(String key, Object value)
      写值 (只有在此 key 原本无值的情况下才会写入)
      Parameters:
      key - 名称
      value - 值
      Returns:
      对象自身