当前位置:网站首页>Encapsulate the unified return object messageresult
Encapsulate the unified return object messageresult
2022-07-28 15:21:00 【A grain of sand in the sea】
package com.wc.robotapi.common;
public class MessageResult<T> {
private boolean Result;
private String ErrorMessage;
private T KeyValue;
public static <T> MessageResult<T> success(T data){
return new MessageResult<T>(data);
}
public static <T> MessageResult<T> success(){
return new MessageResult<T>();
}
public static <T> MessageResult error(String _ErrorMessage){
return new MessageResult<T>(_ErrorMessage);
}
private MessageResult(T data){
this.Result = true;
this.ErrorMessage = "SUCCESS";
this.KeyValue = data;
}
private MessageResult(){
this.Result = true;
this.ErrorMessage = "SUCCESS";
}
private MessageResult(String _ErrorMessage){
// if (_Result) {
// return;
// }
this.Result = false;
this.ErrorMessage = _ErrorMessage;
}
public boolean getResult() {
return Result;
}
public void setResult(Boolean Result) {
this.Result = Result;
}
public String getMessage() {
return ErrorMessage;
}
public void setMessage(String ErrorMessage) {
this.ErrorMessage = ErrorMessage;
}
public T getKeyValue() {
return KeyValue;
}
public void setKeyValue(T KeyValue) {
this.KeyValue = KeyValue;
}
}
边栏推荐
- 一文看懂CRMEB开源在线教育知知识付费系统
- Customer service system attached to crmeb Standard Edition
- 回编译失败
- 4519. 正方形数组的数目
- PMP每日一练 | 考试不迷路-7.28(包含敏捷+多选)
- Apple iPhone app icon hidden how to retrieve and restore the hidden app icon displayed on the iPhone iPhone desktop to the iPhone iPhone iPhone desktop?
- Publish raspberry pie web page with cpolar (release of apache2 web page)
- 4518. Minimum ticket price
- Shader顶点着色器修改顶点高度的一个思路
- Is the expansion operator a deep copy or a shallow copy
猜你喜欢

pyppeteer 遇到的问题

In 2022, the average salary of global programmers was released, and China ranked unexpectedly

使用cpolar发布树莓派网页(apache2的安装测试)

Apple iPhone app icon hidden how to retrieve and restore the hidden app icon displayed on the iPhone iPhone desktop to the iPhone iPhone iPhone desktop?

35道MySQL面试必问题图解,小白都能看懂

The second 1024, come on!

Mlx90640 infrared thermal imager sensor module development notes (VIII)

crmeb 标准版window+phpstudy8安装教程(二)

3588. Permutation and binary

Understanding of entropy and cross entropy loss function
随机推荐
crmeb 标准版Window+phpstudy8安装教程(一)
Understand crmeb open source online education knowledge payment system
Pyinstaller packages py as an EXE file
chrome插件调试
Apple iPhone app icon hidden how to retrieve and restore the hidden app icon displayed on the iPhone iPhone desktop to the iPhone iPhone iPhone desktop?
Repvgg paper explanation and model reproduction using pytoch
苹果iPhone手机APP应用图标隐藏怎么找回恢复显示在iPhone苹果手机桌面显示被隐藏的应用APP图标到iPhone苹果手机桌面?
Three pop-up boxes commonly used in JS
Drawing method using GL under URP
使用cpolar发布树莓派网页(apache2网页的发布)
day 7/12
charles如何安装并使用
Understanding of entropy and cross entropy loss function
shellcode编写(未完)
crmeb 标准版window+phpstudy8安装教程(二)
配置cx-oracle 解决(cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: “Th
Install MOSEK, license installation location search
4518. 最低票价
List of security technologies to be considered in cloud computing
Crmeb Standard Version window+phpstudy8 installation tutorial (I)