This commit is contained in:
RedKale
2016-04-26 16:16:50 +08:00
parent 89c4539218
commit af951b8fcc

View File

@@ -5,11 +5,11 @@
*/
package org.redkale.service;
import org.redkale.convert.json.*;
import org.redkale.convert.json.JsonFactory;
/**
* 通用的结果对象在常见的HTTP+JSON接口中返回的结果需要含结果码错误信息和实体对象。
*
* <p>
* <p>
* 详情见: http://redkale.org
*
@@ -109,6 +109,17 @@ public class RetResult<T> {
this.result = result;
}
/**
* 同 setResult
*
* @param result
* @return
*/
public RetResult result(T result) {
this.result = result;
return this;
}
@Override
public String toString() {
return JsonFactory.root().getConvert().convertTo(this);