类 SaResult
- 所有已实现的接口:
Serializable,Cloneable,Map<String,Object>
对Ajax请求返回Json格式数据的简易封装
所有预留字段:
code=状态码
msg=描述信息
data=携带对象
所有预留字段:
code=状态码
msg=描述信息
data=携带对象
- 作者:
- kong
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static SaResultcode(int code) static SaResultstatic SaResulterror()static SaResultstatic SaResult<T> T获取一个值 根据自定义keygetCode()获取codegetData()获取datagetMsg()获取msgstatic SaResultok()static SaResult写入一个值 自定义key, 连缀风格setCode(int code) 给code赋值,连缀风格给data赋值,连缀风格写入一个Map, 连缀风格给msg赋值,连缀风格toString()从类继承的方法 java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values从类继承的方法 java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size从类继承的方法 java.util.AbstractMap
equals, hashCode从接口继承的方法 java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
字段详细资料
-
构造器详细资料
-
SaResult
public SaResult()构建 -
SaResult
构建- 参数:
code- 状态码msg- 信息data- 数据
-
SaResult
根据 Map 快速构建- 参数:
map- /
-
-
方法详细资料
-
getCode
获取code- 返回:
- code
-
getMsg
获取msg- 返回:
- msg
-
getData
获取data- 返回:
- data
-
setCode
给code赋值,连缀风格- 参数:
code- code- 返回:
- 对象自身
-
setMsg
给msg赋值,连缀风格- 参数:
msg- msg- 返回:
- 对象自身
-
setData
给data赋值,连缀风格- 参数:
data- data- 返回:
- 对象自身
-
set
写入一个值 自定义key, 连缀风格- 参数:
key- keydata- data- 返回:
- 对象自身
-
get
获取一个值 根据自定义key- 类型参数:
T- 要转换为的类型- 参数:
key- keycs- 要转换为的类型- 返回:
- 值
-
setMap
写入一个Map, 连缀风格- 参数:
map- map- 返回:
- 对象自身
-
ok
-
ok
-
code
-
data
-
error
-
error
-
get
-
toString
- 覆盖:
toString在类中AbstractMap<String,Object>
-