我们项目的公告返回类idea警告 idea警告Raw use of parameterized class 'Result' 这会出现什么问题吗
[Java] 纯文本查看 复制代码 package com.ppgjx.app.common.result;
import com.ppgjx.app.constant.AnsCodeKey;
/**
* @Descri2021/9/21
* @Autption 公共返回类
* * [url=home.php?mod=space&uid=264116]@data[/url] hor: LiuBin
* @Modified By:
*/
public class Result<T> {
private Integer code;
private String msg;
private T data;
Result(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
Result(Integer code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
Result(T data) {
this.data = data;
}
Result(T data, String msg) {
this.data = data;
this.msg = msg;
}
public Result() {
}
public int getCode() {
return this.code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return this.msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return this.data;
}
public void setData(T data) {
this.data = data;
}
public static Result error(String msg) {
return new Result(AnsCodeKey.HINT_ERR, msg);
}
public static <T> Result<T> error(T data, String msg) {
return new Result(AnsCodeKey.HINT_ERR, msg, data);
}
public static <T> Result<T> success(T data) {
return new Result(data, "操作成功");
}
public static <T> Result<T> success() {
return new Result(AnsCodeKey.SUCCESS, "操作成功");
}
public static <T> Result<T> success(T data, String msg) {
return new Result(data, msg);
}
public static <T> Result<T> common(Integer code, String msg,T data) {
return new Result(code,msg, data);
}
} |