Class EqualsAvoidNullCheck.FieldFrame
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.FieldFrame
-
- Enclosing class:
- EqualsAvoidNullCheck
private static class EqualsAvoidNullCheck.FieldFrame extends java.lang.Object
Holds the names of fields of a type.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<EqualsAvoidNullCheck.FieldFrame>childrenSet of frame's children.private booleanclassOrEnumOrRecordDefWhether the frame is CLASS_DEF, ENUM_DEF, ENUM_CONST_DEF, or RECORD_DEF.private java.util.Set<DetailAST>fieldsSet of fields.private java.lang.StringframeNameName of the class, enum or enum constant declaration.private java.util.Set<DetailAST>methodCallsSet of equals calls.private EqualsAvoidNullCheck.FieldFrameparentParent frame.
-
Constructor Summary
Constructors Constructor Description FieldFrame(EqualsAvoidNullCheck.FieldFrame parent)Creates new frame.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(EqualsAvoidNullCheck.FieldFrame child)Add child frame to this frame.voidaddField(DetailAST field)Add field to this FieldFrame.voidaddMethodCall(DetailAST methodCall)Add method call to this frame.DetailASTfindField(java.lang.String name)Determines whether this FieldFrame contains the field.java.util.Set<EqualsAvoidNullCheck.FieldFrame>getChildren()Getter for frame's children.private static java.lang.StringgetFieldName(DetailAST field)Get the name of the field.java.lang.StringgetFrameName()Getter for the frame name.java.util.Set<DetailAST>getMethodCalls()Getter for frame's method calls.EqualsAvoidNullCheck.FieldFramegetParent()Getter for the parent frame.booleanisClassOrEnumOrRecordDef()Getter for classOrEnumOrRecordDef.voidsetClassOrEnumOrRecordDef(boolean value)Sets isClassOrEnumOrRecordDef.voidsetFrameName(java.lang.String frameName)Set the frame name.
-
-
-
Field Detail
-
parent
private final EqualsAvoidNullCheck.FieldFrame parent
Parent frame.
-
children
private final java.util.Set<EqualsAvoidNullCheck.FieldFrame> children
Set of frame's children.
-
methodCalls
private final java.util.Set<DetailAST> methodCalls
Set of equals calls.
-
frameName
private java.lang.String frameName
Name of the class, enum or enum constant declaration.
-
classOrEnumOrRecordDef
private boolean classOrEnumOrRecordDef
Whether the frame is CLASS_DEF, ENUM_DEF, ENUM_CONST_DEF, or RECORD_DEF.
-
-
Constructor Detail
-
FieldFrame
FieldFrame(EqualsAvoidNullCheck.FieldFrame parent)
Creates new frame.- Parameters:
parent- parent frame.
-
-
Method Detail
-
setFrameName
public void setFrameName(java.lang.String frameName)
Set the frame name.- Parameters:
frameName- value to set.
-
getFrameName
public java.lang.String getFrameName()
Getter for the frame name.- Returns:
- frame name.
-
getParent
public EqualsAvoidNullCheck.FieldFrame getParent()
Getter for the parent frame.- Returns:
- parent frame.
-
getChildren
public java.util.Set<EqualsAvoidNullCheck.FieldFrame> getChildren()
Getter for frame's children.- Returns:
- children of this frame.
-
addChild
public void addChild(EqualsAvoidNullCheck.FieldFrame child)
Add child frame to this frame.- Parameters:
child- frame to add.
-
addField
public void addField(DetailAST field)
Add field to this FieldFrame.- Parameters:
field- the ast of the field.
-
setClassOrEnumOrRecordDef
public void setClassOrEnumOrRecordDef(boolean value)
Sets isClassOrEnumOrRecordDef.- Parameters:
value- value to set.
-
isClassOrEnumOrRecordDef
public boolean isClassOrEnumOrRecordDef()
Getter for classOrEnumOrRecordDef.- Returns:
- classOrEnumOrRecordDef.
-
addMethodCall
public void addMethodCall(DetailAST methodCall)
Add method call to this frame.- Parameters:
methodCall- METHOD_CALL ast.
-
findField
public DetailAST findField(java.lang.String name)
Determines whether this FieldFrame contains the field.- Parameters:
name- name of the field to check.- Returns:
- true if this FieldFrame contains instance field field.
-
getMethodCalls
public java.util.Set<DetailAST> getMethodCalls()
Getter for frame's method calls.- Returns:
- method calls of this frame.
-
getFieldName
private static java.lang.String getFieldName(DetailAST field)
Get the name of the field.- Parameters:
field- to get the name from.- Returns:
- name of the field.
-
-