
name.remal.classpath.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common Show documentation
Show all versions of common Show documentation
Java & Kotlin tools: common
The newest version!
package name.remal
val CLASS_FILE_NAME_SUFFIX = ".class"
fun classNameToResourceName(className: String) = className.replace('.', '/') + CLASS_FILE_NAME_SUFFIX
fun resourceNameToClassName(resourceName: String): String {
if (!isClassResourceName(resourceName)) throw IllegalArgumentException("$resourceName is not class-resource")
return resourceName.substring(0, resourceName.length - CLASS_FILE_NAME_SUFFIX.length).replace('/', '.')
}
fun isClassResourceName(resourceName: String) = resourceName.endsWith(CLASS_FILE_NAME_SUFFIX)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy