All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ancientlightstudios.quarkus.kotlin.openapi.models.kotlin.MethodName.kt Maven / Gradle / Ivy

There is a newer version: 0.4.14
Show newest version
package com.ancientlightstudios.quarkus.kotlin.openapi.models.kotlin

@Suppress("DataClassPrivateConstructor")
data class MethodName private constructor(val value: String, val packageName: String, val provided: Boolean) {

    fun extend(prefix: String = "", postfix: String = "") = value.methodName(packageName, prefix, postfix)

    companion object {

        fun String.rawMethodName(packageName: String = "", provided: Boolean = false) =
            MethodName(this, packageName, provided)

        fun String.methodName(packageName: String = "", prefix: String = "", postfix: String = "") =
            MethodName("$prefix $this $postfix".toKotlinIdentifier(), packageName, false)

        fun ClassName.companionMethod(name: String) =
            MethodName(name.toKotlinIdentifier(), "$packageName.$value.Companion", false)

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy