public class Result<T> extends Object implements Serializable
Constructor and Description |
---|
Result() |
Modifier and Type | Method and Description |
---|---|
org.springframework.http.ResponseEntity<Result<?>> |
castToResponseEntity() |
BigDecimal |
dataToBigDecimal() |
BigInteger |
dataToBigInteger() |
Boolean |
dataToBoolean() |
Date |
dataToDate() |
Double |
dataToDouble() |
Integer |
dataToInteger() |
<D> D |
dataToJavaBean(Class<D> clazz) |
com.alibaba.fastjson.JSONArray |
dataToJSONArray() |
List<com.alibaba.fastjson.JSONObject> |
dataToJsonList() |
com.alibaba.fastjson.JSONObject |
dataToJSONObject() |
String |
dataToJSONString() |
<D> List<D> |
dataToList(Class<D> clazz) |
Long |
dataToLong() |
<D> D |
dataToObject(Class<D> clazz) |
Date |
dataToSqlDate() |
String |
dataToString() |
Timestamp |
dataToTimestamp() |
<D> D |
getData(Class<D> clazz) |
void |
response()
将Result写入当前请求上下文的响应结果中,如:HttpServletResponse等。具体由当前
WebEnv 环境实现 |
void |
successValidate()
成功校验
|
public void successValidate()
如果此处获得的Result是一个错误提示结果,那么便会抛出一个 ResultException 异常,以便于数据回滚并进行异常统一处理。
ResultException
- 返回的请求异常结果public <D> D getData(Class<D> clazz)
public <D> D dataToObject(Class<D> clazz)
public <D> D dataToJavaBean(Class<D> clazz)
public com.alibaba.fastjson.JSONObject dataToJSONObject()
public com.alibaba.fastjson.JSONArray dataToJSONArray()
public List<com.alibaba.fastjson.JSONObject> dataToJsonList()
public Boolean dataToBoolean()
public Integer dataToInteger()
public Long dataToLong()
public Double dataToDouble()
public BigDecimal dataToBigDecimal()
public BigInteger dataToBigInteger()
public String dataToString()
public String dataToJSONString()
public Date dataToDate()
public Date dataToSqlDate()
public Timestamp dataToTimestamp()
public org.springframework.http.ResponseEntity<Result<?>> castToResponseEntity()
public void response()
WebEnv
环境实现Copyright © 2022 Pivotal Software, Inc.. All rights reserved.