Class ImportLayoutStyle

java.lang.Object
org.openrewrite.kotlin.style.ImportLayoutStyle
All Implemented Interfaces:
KotlinStyle, org.openrewrite.style.Style

public class ImportLayoutStyle extends Object implements KotlinStyle
A Java Style to define how imports are grouped and ordered. Additionally, this style provides configuration to dictate how wildcard folding should be applied when multiple imports are in the same package or on the same, statically-imported type.

The import layout consist of three properties:

  • topLevelSymbolsToUseStarImport - How many imports from the same package must be present before they should be collapsed into a star import. The default is 5.
  • javaStaticsAndEnumsToUseStarImport - How many java static and enum imports from the same type must be present before they should be collapsed into a star import. The default is 3.
  • layout - An ordered list of import groupings which define exactly how imports should be organized within a compilation unit.
  • packagesToFold - An ordered list of packages which are folded when 1 or more types are in use.