사용자 도구

사이트 도구


java:equals_verifier

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
java:equals_verifier [2015/10/28 10:30]
kwon37xi
java:equals_verifier [2018/04/27 17:07]
kwon37xi [Groovy Spock]
줄 23: 줄 23:
  
 ===== IntelliJ Live Template ===== ===== IntelliJ Live Template =====
 +==== java ====
 <code java> <code java>
 class Sub$CLASS$ extends $CLASS$ { class Sub$CLASS$ extends $CLASS$ {
줄 31: 줄 32:
 } }
 EqualsVerifier.forClass($CLASS$.class) EqualsVerifier.forClass($CLASS$.class)
- .suppress(Warning.NONFINAL_FIELDS)+ .suppress(Warning.NULL_FIELDS, Warning.NONFINAL_FIELDS)
  .withRedefinedSubclass(Sub$CLASS$.class)  .withRedefinedSubclass(Sub$CLASS$.class)
  .verify();  .verify();
 </code> </code>
   * Applicable in Java: statement   * Applicable in Java: statement
 +  * Reformat according to style : check
 +  * Use static import if possible : check
 +  * Short FQ names : check
 +
 +==== Groovy Spock ====
 +<code groovy>
 +static class Sub$CLASS$ extends $CLASS$ {
 + @Override
 + boolean canEqual(Object obj) {
 + return false;
 + }
 +}
 +
 +def "equalsAndHashCode verify"() {
 + expect:
 + EqualsVerifier.forClass($CLASS$.class)
 + .suppress(nl.jqno.equalsverifier.Warning.NONFINAL_FIELDS, nl.jqno.equalsverifier.Warning.ALL_FIELDS_SHOULD_BE_USED)
 + .withRedefinedSubclass(Sub$CLASS$.class)
 + .withRedefinedSuperclass()
 + .verify();
 +}
 +</code>
 +
 +  * Applicable in Spock Specification
   * Reformat according to style : check   * Reformat according to style : check
   * Use static import if possible : check   * Use static import if possible : check
   * Short FQ names : check   * Short FQ names : check
java/equals_verifier.txt · 마지막으로 수정됨: 2018/05/02 10:50 저자 kwon37xi