Created
September 20, 2019 11:59
-
-
Save octavian-nita/6e6d9a410c249edeadde47263db580c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ...; | |
import static com.google.common.base.CaseFormat.*; | |
import static com.google.common.base.CharMatcher.is; | |
class CamelName { | |
static <E extends Enum<E>> String camelName(E enumValue) { | |
return enumValue == null ? null : UPPER_UNDERSCORE.to(LOWER_CAMEL, is('_').trimLeadingFrom(enumValue.name())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment