
ru.tinkoff.phobos.configured.naming.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phobos-core_2.12 Show documentation
Show all versions of phobos-core_2.12 Show documentation
Fast xml data binding library
The newest version!
package ru.tinkoff.phobos.configured
object naming {
val camelCase: String => String = _.capitalize
val snakeCase: String => String = {
_.replaceAll(
"([A-Z]+)([A-Z][a-z])",
"$1_$2",
).replaceAll("([a-z\\d])([A-Z])", "$1_$2").toLowerCase
}
val upperSnakeCase: String => String = {
_.replaceAll(
"([A-Z]+)([A-Z][a-z])",
"$1_$2",
).replaceAll("([a-z\\d])([A-Z])", "$1_$2").toUpperCase
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy