@GroovyASTTransformation(phase = CompilePhase.CANONICALIZATION)
public class EqualsAndHashCodeASTTransformation
extends AbstractASTTransformation
Handles generation of equals() and hashCode() methods via the EqualsAndHashCode annotation.
| Fields inherited from class | Fields |
|---|---|
class AbstractASTTransformation |
RETENTION_CLASSNODE, sourceUnit |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static void |
createEquals(ClassNode cNode, boolean includeFields, boolean callSuper, boolean useCanEqual, List<String> excludes, List<String> includes)Generates an equals method for the given class. |
|
public static void |
createEquals(ClassNode cNode, boolean includeFields, boolean callSuper, boolean useCanEqual, List<String> excludes, List<String> includes, boolean allNames)Generates an equals method for the given class. |
|
public static void |
createEquals(ClassNode cNode, boolean includeFields, boolean callSuper, boolean useCanEqual, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties)Generates an equals method for the given class. |
|
public static void |
createEquals(ClassNode cNode, boolean includeFields, boolean callSuper, boolean useCanEqual, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties, boolean pojo)Generates an equals method for the given class. |
|
public static void |
createEquals(ClassNode cNode, boolean includeFields, boolean callSuper, boolean useCanEqual, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties, boolean pojo, boolean useGetter)Generates an equals method for the given class. |
|
public static void |
createHashCode(ClassNode cNode, boolean cacheResult, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes)Generates a hashCode method for the given class. |
|
public static void |
createHashCode(ClassNode cNode, boolean cacheResult, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes, boolean allNames)Generates a hashCode method for the given class. |
|
public static void |
createHashCode(ClassNode cNode, boolean cacheResult, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties)Generates a hashCode method for the given class. |
|
public static void |
createHashCode(ClassNode cNode, boolean cacheResult, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties, boolean pojo)Generates a hashCode method for the given class. |
|
public static void |
createHashCode(ClassNode cNode, boolean cacheResult, boolean includeFields, boolean callSuper, List<String> excludes, List<String> includes, boolean allNames, boolean allProperties, boolean pojo, boolean useGetter)Generates a hashCode method for the given class. |
|
public void |
visit(ASTNode[] nodes, SourceUnit source) |
Generates an equals method for the given class.
cNode - the class to add equals method toincludeFields - whether to include fields in the comparisoncallSuper - whether to include superclass comparisonuseCanEqual - whether to generate and use a canEqual helper methodexcludes - property names to excludeincludes - property names to includeGenerates an equals method for the given class.
cNode - the class to add equals method toincludeFields - whether to include fields in the comparisoncallSuper - whether to include superclass comparisonuseCanEqual - whether to generate and use a canEqual helper methodexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')Generates an equals method for the given class.
cNode - the class to add equals method toincludeFields - whether to include fields in the comparisoncallSuper - whether to include superclass comparisonuseCanEqual - whether to generate and use a canEqual helper methodexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiesGenerates an equals method for the given class.
cNode - the class to add equals method toincludeFields - whether to include fields in the comparisoncallSuper - whether to include superclass comparisonuseCanEqual - whether to generate and use a canEqual helper methodexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiespojo - whether to treat as plain old Java objectGenerates an equals method for the given class.
cNode - the class to add equals method toincludeFields - whether to include fields in the comparisoncallSuper - whether to include superclass comparisonuseCanEqual - whether to generate and use a canEqual helper methodexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiespojo - whether to treat as plain old Java objectuseGetter - whether to use getter methods instead of direct field accessGenerates a hashCode method for the given class.
cNode - the class to add hashCode method tocacheResult - whether to cache the hash code in a fieldincludeFields - whether to include fields in the hash codecallSuper - whether to include superclass hash codeexcludes - property names to excludeincludes - property names to includeGenerates a hashCode method for the given class.
cNode - the class to add hashCode method tocacheResult - whether to cache the hash code in a fieldincludeFields - whether to include fields in the hash codecallSuper - whether to include superclass hash codeexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')Generates a hashCode method for the given class.
cNode - the class to add hashCode method tocacheResult - whether to cache the hash code in a fieldincludeFields - whether to include fields in the hash codecallSuper - whether to include superclass hash codeexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiesGenerates a hashCode method for the given class.
cNode - the class to add hashCode method tocacheResult - whether to cache the hash code in a fieldincludeFields - whether to include fields in the hash codecallSuper - whether to include superclass hash codeexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiespojo - whether to treat as plain old Java objectGenerates a hashCode method for the given class.
cNode - the class to add hashCode method tocacheResult - whether to cache the hash code in a fieldincludeFields - whether to include fields in the hash codecallSuper - whether to include superclass hash codeexcludes - property names to excludeincludes - property names to includeallNames - whether to include all names (including internal ones with '$')allProperties - whether to process all propertiespojo - whether to treat as plain old Java objectuseGetter - whether to use getter methods instead of direct field access