Record Class CustomImportOrderCheck.ImportDetails

java.lang.Object
java.lang.Record
com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck.ImportDetails
Record Components:
importFullPath - import full path
importGroup - import group
staticImport - if import is static
importAST - 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 Details

  • Constructor Details

    • ImportDetails

      private ImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST)
      Creates an instance of a ImportDetails record class.
      Parameters:
      importFullPath - the value for the importFullPath record component
      importGroup - the value for the importGroup record component
      staticImport - the value for the staticImport record component
      importAST - the value for the importAST record component
  • Method Details

    • getStartLineNumber

      public int getStartLineNumber()
      Get import start line number from ast.
      Returns:
      import start line from ast.
    • getEndLineNumber

      public int 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • importFullPath

      Returns the value of the importFullPath record component.
      Returns:
      the value of the importFullPath record component
    • importGroup

      public String importGroup()
      Returns the value of the importGroup record component.
      Returns:
      the value of the importGroup record component
    • staticImport

      public boolean staticImport()
      Returns the value of the staticImport record component.
      Returns:
      the value of the staticImport record component
    • importAST

      public DetailAST importAST()
      Returns the value of the importAST record component.
      Returns:
      the value of the importAST record component