吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3249|回复: 0
收起左侧

[求助] Raw use of parameterized class 'Result' 警告

[复制链接]
积木工具箱 发表于 2021-9-24 19:57
我们项目的公告返回类idea警告 idea警告Raw use of parameterized class 'Result' 这会出现什么问题吗

de72ac7e3994713fba63ebc5d099d9a.png

[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);
    }
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 22:35

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表