Package cn.dev33.satoken.application
Class SaApplication
java.lang.Object
cn.dev33.satoken.application.SaApplication
- All Implemented Interfaces:
SaGetValueInterface,SaSetValueInterface
Application Model,全局作用域的读取值对象。
在应用全局范围内: 存值、取值。数据在应用重启后失效,如果集成了 Redis,则在 Redis 重启后失效。
- Since:
- 1.31.0
- Author:
- click33
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()清空当前存入的所有 key删值取值keys()返回当前存入的所有 key写值写值splicingDataKey(String key) 拼接key:当存入一个变量时,应该使用的 keyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cn.dev33.satoken.application.SaGetValueInterface
get, getDouble, getFloat, getInt, getLong, getModel, getModel, getString, getValueByDefaultValue, has, valueIsNullMethods inherited from interface cn.dev33.satoken.application.SaSetValueInterface
get, setByNull
-
Field Details
-
defaultInstance
默认实例
-
-
Constructor Details
-
SaApplication
public SaApplication()
-
-
Method Details
-
get
取值- Specified by:
getin interfaceSaGetValueInterface- Parameters:
key- key- Returns:
- 值
-
set
写值- Specified by:
setin interfaceSaSetValueInterface- Parameters:
key- 名称value- 值- Returns:
- 对象自身
-
delete
删值- Specified by:
deletein interfaceSaSetValueInterface- Parameters:
key- 要删除的key- Returns:
- 对象自身
-
set
写值- Parameters:
key- 名称value- 值ttl- 有效时间(单位:秒)- Returns:
- 对象自身
-
keys
返回当前存入的所有 key- Returns:
- /
-
clear
public void clear()清空当前存入的所有 key -
splicingDataKey
拼接key:当存入一个变量时,应该使用的 key- Parameters:
key- 原始 key- Returns:
- 拼接后的 key 值
-