是否可以为equals()和hashCode()更改IntelliJ的代码生成模板 [英] Is it possible to change IntelliJ's code generation template for equals() and hashCode()

查看:553
本文介绍了是否可以为equals()和hashCode()更改IntelliJ的代码生成模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改 equals() hashCode()的代码生成模板?

Is it possible to change the code generation template for equals() and hashCode()?

我希望生成的代码使用Java 7 Objects 类来获取这些方法。

I would like the generated code to use the Java 7 Objects class for theses methods.

推荐答案

发布14.1 可以自定义equals()/ hashCode()的代码生成模板,而无需使用任何第三方插件。

As of release 14.1 of the Ultimate Edition it is possible to customize the Code generation template of equals()/hashCode() without the use of any third party plugin.

按Alt + Insert(生成...),选择equals()和hashCode(),您将能够选择其中一个预定义的模板或您自己的自定义模板。

Press "Alt + Insert" (Generate...), choose "equals() and hashCode()" and you will be able to select one of the predefined templates or a customized template of your own.

这篇关于是否可以为equals()和hashCode()更改IntelliJ的代码生成模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆