Class ImportOrganizer.OrganizedImports

java.lang.Object
com.google.errorprone.apply.ImportOrganizer.OrganizedImports
Enclosing interface:
ImportOrganizer

public static class ImportOrganizer.OrganizedImports
extends Object
Provides support for building a list of imports from groups and formatting it as a block of imports.
  • Constructor Details

    • OrganizedImports

      public OrganizedImports()
  • Method Details

    • asImportBlock

      public String asImportBlock()
      Get the organized imports as a block of imports, with blank links between the separate groups.
    • addGroups

      public <K> ImportOrganizer.OrganizedImports addGroups​(Map<K,​? extends Collection<ImportOrganizer.Import>> groups, Iterable<K> keys)
      Add groups of already sorted imports.

      If there are any other imports in the list then this will add a newline separator before any groups are added. It will also add a newline separate between each group.

      Parameters:
      groups - the imports in the group.
      keys - the keys to add, in order, if a key is not in the groups then it is ignored.
      Returns:
      this for chaining.