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>
children
Set of frame's children.private boolean
classOrEnumOrEnumConstDef
Whether the frame is CLASS_DEF, ENUM_DEF or ENUM_CONST_DEF.private java.util.Set<DetailAST>
fields
Set of fields.private java.lang.String
frameName
Name of the class, enum or enum constant declaration.private java.util.Set<DetailAST>
methodCalls
Set of equals calls.private EqualsAvoidNullCheck.FieldFrame
parent
Parent 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 void
addChild(EqualsAvoidNullCheck.FieldFrame child)
Add child frame to this frame.void
addField(DetailAST field)
Add field to this FieldFrame.void
addMethodCall(DetailAST methodCall)
Add method call to this frame.DetailAST
findField(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.String
getFieldName(DetailAST field)
Get the name of the field.java.lang.String
getFrameName()
Getter for the frame name.java.util.Set<DetailAST>
getMethodCalls()
Getter for frame's method calls.EqualsAvoidNullCheck.FieldFrame
getParent()
Getter for the parent frame.boolean
isClassOrEnumOrEnumConstDef()
Getter for classOrEnumOrEnumConstDef.void
setClassOrEnumOrEnumConstDef(boolean value)
Sets isClassOrEnum.void
setFrameName(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.
-
fields
private final java.util.Set<DetailAST> fields
Set of fields.
-
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.
-
classOrEnumOrEnumConstDef
private boolean classOrEnumOrEnumConstDef
Whether the frame is CLASS_DEF, ENUM_DEF or ENUM_CONST_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.
-
setClassOrEnumOrEnumConstDef
public void setClassOrEnumOrEnumConstDef(boolean value)
Sets isClassOrEnum.- Parameters:
value
- value to set.
-
isClassOrEnumOrEnumConstDef
public boolean isClassOrEnumOrEnumConstDef()
Getter for classOrEnumOrEnumConstDef.- Returns:
- classOrEnumOrEnumConstDef.
-
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.
-
-