Class EqualChecker<C>

java.lang.Object
caseine.reflect.EqualChecker<C>
Type Parameters:
C - The class to check

public class EqualChecker<C> extends Object
A class to check if - equals method of the class C is declared with Object parameter - hashcode method of a class T is well declared - t.equals(null) is false, where t is of type T - t.equals(t) is true, where t is of type T
  • Constructor Details

    • EqualChecker

      @Deprecated public EqualChecker(Class<C> classToCheck, com.github.javaparser.ast.stmt.BlockStmt bodyToCheck)
      Deprecated.
    • EqualChecker

      public EqualChecker(Class<C> classToCheck)
      Parameters:
      classToCheck - The object class of class C whose equals et hashCode methods we want to check
  • Method Details

    • getCheckedClass

      public Class<C> getCheckedClass()
      Returns:
      Object class of C
    • isEqualsDeclared

      public boolean isEqualsDeclared()
      Returns:
      equals method with an only Object parameter exists
    • isHashcodeDeclared

      public boolean isHashcodeDeclared()
      Returns:
      hashCode method with no parameter exists
    • isAbleToInstantiate

      public boolean isAbleToInstantiate()
      Returns:
      It was possible to instantiate T
    • isNotEqualToNull

      public boolean isNotEqualToNull()
      Returns:
      c.equals(null) is false, where c is of type C
    • isEqualToItSelf

      public boolean isEqualToItSelf()
      Returns:
      c.equals(c) is true, where c is of type C
    • isNotUseInstanceOf

      public boolean isNotUseInstanceOf()
      Returns:
      equals does not use instanceOf (relevant if it exists)
    • getEquals

      public Method getEquals()
      Returns:
      the reflected object class of the clone method or null if does not exist
    • getHashCode

      public Method getHashCode()
      Returns:
      the reflected object class of the hashCode method or null if does not exist
    • getBodyToCheck

      @Deprecated public com.github.javaparser.ast.stmt.BlockStmt getBodyToCheck()
      Deprecated.
    • getBodyOfEquals

      public com.github.javaparser.ast.stmt.BlockStmt getBodyOfEquals()
      Returns:
      The parsed body of the equals method of C is it exists or null
    • getBodyOfHashCode

      public com.github.javaparser.ast.stmt.BlockStmt getBodyOfHashCode()
      Returns:
      The parsed body of the hashCode method of C is it exists or null