Package org.openrewrite.kotlin.style
Class ImportLayoutStyle.Block.ImportPackage
java.lang.Object
org.openrewrite.kotlin.style.ImportLayoutStyle.Block.ImportPackage
- All Implemented Interfaces:
ImportLayoutStyle.Block
- Direct Known Subclasses:
ImportLayoutStyle.Block.AllAliases,ImportLayoutStyle.Block.AllOthers
- Enclosing interface:
ImportLayoutStyle.Block
public static class ImportLayoutStyle.Block.ImportPackage
extends Object
implements ImportLayoutStyle.Block
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openrewrite.kotlin.style.ImportLayoutStyle.Block
ImportLayoutStyle.Block.AllAliases, ImportLayoutStyle.Block.AllOthers, ImportLayoutStyle.Block.BlankLines, ImportLayoutStyle.Block.ImportPackage -
Constructor Summary
ConstructorsConstructorDescriptionImportPackage(String packageWildcard, boolean withSubpackages, boolean acceptAliasImport) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(org.openrewrite.java.tree.JRightPadded<org.openrewrite.java.tree.J.Import> anImport) This method will determine if the passed in import is a match for the rules defined on the block.List<org.openrewrite.java.tree.JRightPadded<org.openrewrite.java.tree.J.Import>> orderedImports(org.openrewrite.kotlin.style.ImportLayoutStyle.LayoutState layoutState, int classCountToUseStarImport, int nameCountToUseStarImport, org.openrewrite.kotlin.style.ImportLayoutStyle.ImportLayoutConflictDetection importLayoutConflictDetection, List<ImportLayoutStyle.Block> packagesToFold) toString()
-
Constructor Details
-
ImportPackage
-
-
Method Details
-
getPackageWildcard
-
accept
public boolean accept(org.openrewrite.java.tree.JRightPadded<org.openrewrite.java.tree.J.Import> anImport) Description copied from interface:ImportLayoutStyle.BlockThis method will determine if the passed in import is a match for the rules defined on the block. If the import is matched, it will be internally stored in the block.- Specified by:
acceptin interfaceImportLayoutStyle.Block- Parameters:
anImport- The import to be compared against the block's matching rules.- Returns:
trueif the import was a match
-
orderedImports
public List<org.openrewrite.java.tree.JRightPadded<org.openrewrite.java.tree.J.Import>> orderedImports(org.openrewrite.kotlin.style.ImportLayoutStyle.LayoutState layoutState, int classCountToUseStarImport, int nameCountToUseStarImport, org.openrewrite.kotlin.style.ImportLayoutStyle.ImportLayoutConflictDetection importLayoutConflictDetection, List<ImportLayoutStyle.Block> packagesToFold) - Specified by:
orderedImportsin interfaceImportLayoutStyle.Block- Returns:
- Imports belonging to this block, folded appropriately.
-
toString
-