Skip to content

Commit

Permalink
✨ Add moduleName in ClassFqn
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuchan authored Nov 3, 2024
1 parent 7954ba8 commit 64061fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/creator/custom/model/ClassFqn.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ data class ClassFqn(val fqn: String) {
*/
val packagePath by lazy { packageName.replace('.', '/') }

/**
* The module name, which is the last part of the packageName
*/
val moduleName by lazy { packageName.substringAfterLast('.') }

fun withClassName(className: String) = copy("$packageName.$className")

fun withSubPackage(name: String) = copy("$packageName.$name.$className")
Expand Down

0 comments on commit 64061fa

Please sign in to comment.