public class ResultModel<T> extends HashMap implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ResultModel.keyNames
本实体类中的常用键名称
|
static class |
ResultModel.resultStatus
处理结果状态枚举
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
static String |
KEY_STATUS
结果状态键名
|
Constructor and Description |
---|
ResultModel()
缺省的构造函数,状态值为“0”(STATUS_FAIL),
|
ResultModel(int status)
指定状态值的构造函数
top.hmtools.model.ResultModelHashmap.STATUS_SUCCESS :成功状态 top.hmtools.model.ResultModelHashmap.STATUS_FAIL:失败状态 |
ResultModel(ResultModel.resultStatus status)
指定状态值的构造函数
|
Modifier and Type | Method and Description |
---|---|
void |
addToRows(T... rows)
追加数据到列表数据集
|
<TT> TT |
get(Object key,
Class<TT> type)
根据key获取映射中的值
|
<TT> TT |
get(ResultModel.keyNames key,
Class<TT> type)
根据key获取映射中的值
|
String |
getMessage()
获取反馈消息
方法说明: getMessage
输入参数说明: @return
输出参数说明: String
|
List<T> |
getRows()
获取列表集合数据
方法说明: getRows
输入参数说明: @return
输出参数说明: List
|
List<T> |
getRows(Class<T> type)
获取列表集合数据
|
String |
getStatus()
获取执行结果状态
方法说明: getStatus
输入参数说明: @return
输出参数说明: String
|
boolean |
isStatusFail()
是否是执行失败状态
|
boolean |
isStatusSuccess()
是否是执行成功状态
|
void |
setMessage(String msg)
修改反馈消息
方法说明: message
输入参数说明: @param msg
输出参数说明: void
|
void |
setRows(List<T> rows)
设置列表集合数据
方法说明: setRows
输入参数说明: @param rows
输出参数说明: void
|
void |
setRows(T... rows)
设置列表集合数据
|
void |
setStatus(ResultModel.resultStatus status)
设置执行结果状态
方法说明: setStatus
输入参数说明: @param status
输出参数说明: void
|
void |
setStatusFail()
标记执行状态为 失败
方法说明: statusFail
输入参数说明:
输出参数说明: void
|
void |
setStatusSuccess()
标记执行状态为 成功
方法说明: statusSuccess
输入参数说明:
输出参数说明: void
|
void |
sSetRows(T... rows)
Deprecated.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public static final String KEY_STATUS
public ResultModel()
public ResultModel(int status)
public ResultModel(ResultModel.resultStatus status)
public void setRows(T... rows)
rows
- @Deprecated public void sSetRows(T... rows)
rows
- public void addToRows(T... rows)
rows
- public <TT> TT get(ResultModel.keyNames key, Class<TT> type)
key
- type
- public void setStatus(ResultModel.resultStatus status)
public String getStatus()
public boolean isStatusSuccess()
public boolean isStatusFail()
public void setStatusSuccess()
public void setStatusFail()
public void setMessage(String msg)
public String getMessage()
Copyright © 2018. All rights reserved.