Intellij IDEA 安装lombok及使用详解

参考
https://blog.csdn.net/zhglance/article/details/54931430
https://blog.csdn.net/ghsau/article/details/52334762

跟着https://blog.csdn.net/zhglance/article/details/54931430步骤做完
这里写图片描述
发现get,set等方法都不能识别,这时需要重启idea,然后idea会提示:
这里写图片描述
需要设置下,才能使用注解的功能,如下:
这里写图片描述
设置好了之后,运行便不再报错。
这里写图片描述
且可以看到Student.class如下:

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

public class Student {
    private String name;
    private int age;
    private String male;
    private String studentNo;

    public Student() {
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setMale(String male) {
        this.male = male;
    }

    public void setStudentNo(String studentNo) {
        this.studentNo = studentNo;
    }

    public String getName() {
        return this.name;
    }

    public int getAge() {
        return this.age;
    }

    public String getMale() {
        return this.male;
    }

    public String getStudentNo() {
        return this.studentNo;
    }

    public String toString() {
        return "Student(name=" + this.getName() + ", age=" + this.getAge() + ", male=" + this.getMale() + ", studentNo=" + this.getStudentNo() + ")";
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Student)) {
            return false;
        } else {
            Student other = (Student)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                if (this.getAge() != other.getAge()) {
                    return false;
                } else {
                    Object this$male = this.getMale();
                    Object other$male = other.getMale();
                    if (this$male == null) {
                        if (other$male != null) {
                            return false;
                        }
                    } else if (!this$male.equals(other$male)) {
                        return false;
                    }

                    Object this$studentNo = this.getStudentNo();
                    Object other$studentNo = other.getStudentNo();
                    if (this$studentNo == null) {
                        if (other$studentNo != null) {
                            return false;
                        }
                    } else if (!this$studentNo.equals(other$studentNo)) {
                        return false;
                    }

                    return true;
                }
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof Student;
    }

    public int hashCode() {
        int PRIME = true;
        int result = 1;
        Object $name = this.getName();
        int result = result * 59 + ($name == null ? 43 : $name.hashCode());
        result = result * 59 + this.getAge();
        Object $male = this.getMale();
        result = result * 59 + ($male == null ? 43 : $male.hashCode());
        Object $studentNo = this.getStudentNo();
        result = result * 59 + ($studentNo == null ? 43 : $studentNo.hashCode());
        return result;
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,你可以按照以下步骤下载和安装 IntelliJ IDEA: 1. 打开浏览器,访问 JetBrains 官方网站:https://www.jetbrains.com/idea/。 2. 在选择页面中,选择适合你操作系统的版本(Windows、macOS 或 Linux)。 3. 点击下载按钮以下载安装程序。 安装 IntelliJ IDEA: Windows: 1. 双击下载的安装程序(以 `.exe` 结尾)启动安装向导。 2. 在安装向导中,按照默认设置一直点击“下一步”直到完成安装。 3. 安装完成后,启动 IntelliJ IDEA。 macOS: 1. 双击下载的安装程序(以 `.dmg` 结尾)将其挂载到 Finder 中。 2. 在 Finder 中,将 IntelliJ IDEA 图标拖放到 "Applications" 文件夹中。 3. 在 "Applications" 文件夹中找到 IntelliJ IDEA 图标并双击打开。 Linux: 1. 解压下载的安装包(以 `.tar.gz` 或 `.tar.xz` 结尾)到目标文件夹中。 ```shell tar xfz ideaIC-*.tar.gz # 以 .tar.gz 结尾的安装包 # 或 tar xfJ ideaIC-*.tar.xz # 以 .tar.xz 结尾的安装包 ``` 2. 进入解压后的目标文件夹。 ```shell cd idea-IC-* ``` 3. 在终端中运行 `bin/idea.sh` 启动 IntelliJ IDEA。 配置 IntelliJ IDEA: 1. 在首次运行 IntelliJ IDEA 时,你需要选择一种 UI 主题和键盘布局。根据个人喜好进行选择,并点击“Next”。 2. 在接下来的界面中,你可以选择导入旧版本的设置、安装插件或使用默认设置。根据需要进行选择,并点击“Next”。 3. 在下一个界面中,你可以选择是否参与用户体验计划。根据个人偏好进行选择,并点击“Next”。 4. 最后,你可以创建或导入项目,也可以直接进入 IntelliJ IDEA 的主界面开始使用。 现在,你已经成功下载、安装和配置 IntelliJ IDEA。开始享受开发吧!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值