Record Class CustomImportOrderCheck.ImportDetails
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck.ImportDetails
- Record Components:
importFullPath- import full pathimportGroup- import groupstaticImport- if import is staticimportAST- import AST
- Enclosing class:
CustomImportOrderCheck
private static record CustomImportOrderCheck.ImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST)
extends Record
Contains import attributes as line number, import full path, import
group.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DetailASTThe field for theimportASTrecord component.private final StringThe field for theimportFullPathrecord component.private final StringThe field for theimportGrouprecord component.private final booleanThe field for thestaticImportrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST) Creates an instance of aImportDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intGet import end line number from ast.intGet import start line number from ast.final inthashCode()Returns a hash code value for this object.Returns the value of theimportASTrecord component.Returns the value of theimportFullPathrecord component.Returns the value of theimportGrouprecord component.booleanReturns the value of thestaticImportrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
importFullPath
The field for theimportFullPathrecord component. -
importGroup
The field for theimportGrouprecord component. -
staticImport
The field for thestaticImportrecord component. -
importAST
The field for theimportASTrecord component.
-
-
Constructor Details
-
ImportDetails
private ImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST) Creates an instance of aImportDetailsrecord class.- Parameters:
importFullPath- the value for theimportFullPathrecord componentimportGroup- the value for theimportGrouprecord componentstaticImport- the value for thestaticImportrecord componentimportAST- the value for theimportASTrecord component
-
-
Method Details
-
getStartLineNumber
Get import start line number from ast.- Returns:
- import start line from ast.
-
getEndLineNumber
Get import end line number from ast.Note: It can be different from startLineNumber when import statement span multiple lines.
- Returns:
- import end line from ast.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
importFullPath
Returns the value of theimportFullPathrecord component.- Returns:
- the value of the
importFullPathrecord component
-
importGroup
Returns the value of theimportGrouprecord component.- Returns:
- the value of the
importGrouprecord component
-
staticImport
Returns the value of thestaticImportrecord component.- Returns:
- the value of the
staticImportrecord component
-
importAST
Returns the value of theimportASTrecord component.- Returns:
- the value of the
importASTrecord component
-