Layer

data class Layer(name: String, rootPackage: String)

Represents an architectural layer within a software system.

A layer is defined by its name and a root package path that determines which code belongs to this layer. The root package path supports wildcards using ".." notation to include all subpackages.

Example usage:

val domainLayer = Layer("Domain", "com.example.domain..")
val presentationLayer = Layer("Presentation", "com.example.presentation..")

Package naming rules:

  • Must end with ".." to indicate inclusion of all subpackages

  • Cannot be empty (just "..")

  • Cannot start with a dot

  • Each package segment must:

  • Start with a lowercase letter

  • Contain only lowercase letters, numbers, or underscores

  • Follow standard Java package naming conventions

  • Intermediate ".." wildcards are allowed (e.g., "com..domain..")

Throws

If name or rootPackage is blank

Constructors

Link copied to clipboard
constructor(name: String, rootPackage: String)