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 booleanWhether the frame is CLASS_DEF, ENUM_DEF, ENUM_CONST_DEF, or RECORD_DEF.Map of field name to field DetailAst.private StringName of the class, enum or enum constant declaration.Set of equals calls.private final EqualsAvoidNullCheck.FieldFrameParent frame. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates new frame. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd child frame to this frame.voidAdd field to this FieldFrame.voidaddMethodCall(DetailAST methodCall) Add method call to this frame.Determines whether this FieldFrame contains the field.Getter for frame's children.private static StringgetFieldName(DetailAST field) Get the name of the field.Getter for the frame name.Getter for frame's method calls.Getter for the parent frame.booleanGetter for classOrEnumOrRecordDef.voidsetClassOrEnumOrRecordDef(boolean value) Sets isClassOrEnumOrRecordDef.voidsetFrameName(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.
-