Class EqualsAvoidNullCheck.FieldFrame

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.FieldFrame
Enclosing class:
EqualsAvoidNullCheck

private static class EqualsAvoidNullCheck.FieldFrame extends Object
Holds the names of fields of a type.
  • Field Details

    • parent

      private final EqualsAvoidNullCheck.FieldFrame parent
      Parent frame.
    • children

      private final Set<EqualsAvoidNullCheck.FieldFrame> children
      Set of frame's children.
    • fields

      private final Set<DetailAST> fields
      Set of fields.
    • methodCalls

      private final Set<DetailAST> methodCalls
      Set of equals calls.
    • frameName

      private 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 Details

  • Method Details

    • setFrameName

      public void setFrameName(String frameName)
      Set the frame name.
      Parameters:
      frameName - value to set.
    • getFrameName

      public 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 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(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 Set<DetailAST> getMethodCalls()
      Getter for frame's method calls.
      Returns:
      method calls of this frame.
    • getFieldName

      private static String getFieldName(DetailAST field)
      Get the name of the field.
      Parameters:
      field - to get the name from.
      Returns:
      name of the field.