Class EqualsAvoidNullCheck.FieldFrame
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.FieldFrame
- Enclosing class:
- EqualsAvoidNullCheck
Holds the names of fields of a type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<EqualsAvoidNullCheck.FieldFrame>
Set of frame's children.private boolean
Whether the frame is CLASS_DEF, ENUM_DEF, ENUM_CONST_DEF, or RECORD_DEF.Map of field name to field DetailAst.private String
Name of the class, enum or enum constant declaration.Set of equals calls.private final EqualsAvoidNullCheck.FieldFrame
Parent frame. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Creates new frame. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add child frame to this frame.void
Add field to this FieldFrame.void
addMethodCall
(DetailAST methodCall) Add method call to this frame.Determines whether this FieldFrame contains the field.Getter for frame's children.private static String
getFieldName
(DetailAST field) Get the name of the field.Getter for the frame name.Getter for frame's method calls.Getter for the parent frame.boolean
Getter for classOrEnumOrRecordDef.void
setClassOrEnumOrRecordDef
(boolean value) Sets isClassOrEnumOrRecordDef.void
setFrameName
(String frameName) Set the frame name.
-
Field Details
-
parent
Parent frame. -
children
Set of frame's children. -
fieldNameToAst
Map of field name to field DetailAst. -
methodCalls
Set of equals calls. -
frameName
Name of the class, enum or enum constant declaration. -
classOrEnumOrRecordDef
Whether the frame is CLASS_DEF, ENUM_DEF, ENUM_CONST_DEF, or RECORD_DEF.
-
-
Constructor Details
-
FieldFrame
Creates new frame.- Parameters:
parent
- parent frame.
-
-
Method Details
-
setFrameName
Set the frame name.- Parameters:
frameName
- value to set.
-
getFrameName
Getter for the frame name.- Returns:
- frame name.
-
getParent
Getter for the parent frame.- Returns:
- parent frame.
-
getChildren
Getter for frame's children.- Returns:
- children of this frame.
-
addChild
Add child frame to this frame.- Parameters:
child
- frame to add.
-
addField
Add field to this FieldFrame.- Parameters:
field
- the ast of the field.
-
setClassOrEnumOrRecordDef
Sets isClassOrEnumOrRecordDef.- Parameters:
value
- value to set.
-
isClassOrEnumOrRecordDef
Getter for classOrEnumOrRecordDef.- Returns:
- classOrEnumOrRecordDef.
-
addMethodCall
Add method call to this frame.- Parameters:
methodCall
- METHOD_CALL ast.
-
findField
Determines whether this FieldFrame contains the field.- Parameters:
name
- name of the field to check.- Returns:
- DetailAST if this FieldFrame contains instance field.
-
getMethodCalls
Getter for frame's method calls.- Returns:
- method calls of this frame.
-
getFieldName
Get the name of the field.- Parameters:
field
- to get the name from.- Returns:
- name of the field.
-