Class ImportOrganizer.OrganizedImports
java.lang.Object
com.google.errorprone.apply.ImportOrganizer.OrganizedImports
- Enclosing interface:
ImportOrganizer
Provides support for building a list of imports from groups and formatting it as a block of
imports.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddGroups
(Map<K, ? extends Collection<ImportOrganizer.Import>> groups, Iterable<K> keys) Add groups of already sorted imports.Get the organized imports as a block of imports, with blank links between the separate groups.
-
Constructor Details
-
OrganizedImports
public OrganizedImports()
-
-
Method Details
-
asImportBlock
Get the organized imports as a block of imports, with blank links between the separate groups. -
addGroups
@CanIgnoreReturnValue 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.
-