Record Class ModuleImportOrderCheck.ImportEntry
java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.checks.imports.ModuleImportOrderCheck.ImportEntry
- Record Components:
name- fully qualified name of the importmodule- whether the import is a module importast- import AST
- Enclosing class:
ModuleImportOrderCheck
private static record ModuleImportOrderCheck.ImportEntry(String name, boolean module, DetailAST ast)
extends Record
Contains import attributes as import full path, module flag and import AST.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImportEntry(String name, boolean module, DetailAST ast) Creates an instance of aImportEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionast()Returns the value of theastrecord component.final booleanIndicates whether some other object is "equal to" this one.(package private) intGet import end line number from ast.(package private) intGet import start line number from ast.final inthashCode()Returns a hash code value for this object.booleanmodule()Returns the value of themodulerecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
Method Details
-
getStartLineNumber
int getStartLineNumber()Get import start line number from ast.- Returns:
- import start line from ast.
-
getEndLineNumber
int getEndLineNumber()Get import end line number from ast.Note: It can be different from startLineNumber when import statement spans 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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
module
Returns the value of themodulerecord component.- Returns:
- the value of the
modulerecord component
-
ast
Returns the value of theastrecord component.- Returns:
- the value of the
astrecord component
-