Package: groovy.org.codenarc.rule.design

## [Groovy] Class PrivateFieldCouldBeFinalRule

- groovy.org.codenarc.rule.design.PrivateFieldCouldBeFinalRule

- Rule that checks for private fields that are only set within a constructor or field initializer. Such fields can safely be made final.

  Authors:
    Chris Mair

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Class` | `astVisitorClass`
    `String` | `ignoreFieldNames`
    `boolean` | `ignoreJpaEntities`
    `String` | `name`
    `int` | `priority`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected List<Violation>` | `getViolations(AstVisitor visitor, SourceCode sourceCode)`
    `` | `boolean` | `isDefinedInJpaEntity(org.codehaus.groovy.ast.FieldNode fieldNode)`

- - ### Property Detail

    - #### Class astVisitorClass

    - #### String ignoreFieldNames

    - #### boolean ignoreJpaEntities

    - #### String name

    - #### int priority

  - ### Method Detail

    - #### @Override protected List<Violation> getViolations(AstVisitor visitor, SourceCode sourceCode)

    - #### boolean isDefinedInJpaEntity(org.codehaus.groovy.ast.FieldNode fieldNode)