Package caseine.reflect
Class EqualChecker<C>
java.lang.Object
caseine.reflect.EqualChecker<C>
- Type Parameters:
C- The class to check
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 Summary
ConstructorsConstructorDescriptionEqualChecker(Class<C> classToCheck) EqualChecker(Class<C> classToCheck, com.github.javaparser.ast.stmt.BlockStmt bodyToCheck) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.javaparser.ast.stmt.BlockStmtcom.github.javaparser.ast.stmt.BlockStmtcom.github.javaparser.ast.stmt.BlockStmtDeprecated.booleanbooleanbooleanbooleanbooleanboolean
-
Constructor Details
-
EqualChecker
@Deprecated public EqualChecker(Class<C> classToCheck, com.github.javaparser.ast.stmt.BlockStmt bodyToCheck) Deprecated. -
EqualChecker
- Parameters:
classToCheck- The object class of class C whose equals et hashCode methods we want to check
-
-
Method Details
-
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
- Returns:
- the reflected object class of the clone method or null if does not exist
-
getHashCode
- Returns:
- the reflected object class of the hashCode method or null if does not exist
-
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
-