Class UnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.coding.UnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails
-
- Enclosing class:
- UnusedLambdaParameterShouldBeUnnamedCheck
private static final class UnusedLambdaParameterShouldBeUnnamedCheck.LambdaParameterDetails extends Object
Maintains information about the lambda parameter.
-
-
Field Summary
Fields Modifier and Type Field Description private DetailAST
enclosingLambda
Ast of typeTokenTypes.LAMBDA
enclosing the lambda parameter.private DetailAST
identifierAst
Ast of typeTokenTypes.IDENT
of the given lambda parameter.private boolean
used
Is the variable used.
-
Constructor Summary
Constructors Modifier Constructor Description private
LambdaParameterDetails(DetailAST enclosingLambda, DetailAST identifierAst)
Create a new lambda parameter instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private DetailAST
getIdentifierAst()
Get ast of typeTokenTypes.IDENT
of the given lambda parameter.private String
getName()
Get the name of the lambda parameter.private boolean
isUsed()
Check if the lambda parameter is used.private void
registerAsUsed()
Register the lambda parameter as used.
-
-
-
Field Detail
-
enclosingLambda
private final DetailAST enclosingLambda
Ast of typeTokenTypes.LAMBDA
enclosing the lambda parameter.
-
identifierAst
private final DetailAST identifierAst
Ast of typeTokenTypes.IDENT
of the given lambda parameter.
-
used
private boolean used
Is the variable used.
-
-
Constructor Detail
-
LambdaParameterDetails
private LambdaParameterDetails(DetailAST enclosingLambda, DetailAST identifierAst)
Create a new lambda parameter instance.- Parameters:
enclosingLambda
- ast of typeTokenTypes.LAMBDA
identifierAst
- ast of typeTokenTypes.IDENT
-
-
Method Detail
-
registerAsUsed
private void registerAsUsed()
Register the lambda parameter as used.
-
getName
private String getName()
Get the name of the lambda parameter.- Returns:
- the name of the lambda parameter
-
getIdentifierAst
private DetailAST getIdentifierAst()
Get ast of typeTokenTypes.IDENT
of the given lambda parameter.- Returns:
- ast of type
TokenTypes.IDENT
of the given lambda parameter
-
isUsed
private boolean isUsed()
Check if the lambda parameter is used.- Returns:
- true if the lambda parameter is used
-
-