public interface PropertyNamingStrategy
Note that implementations are used only at build time and not at runtime, therefore adding a new implementation entails ensuring the implementation exists on the annotation processor classpath
Modifier and Type | Field and Description |
---|---|
static PropertyNamingStrategy |
IDENTITY
Property name as is without changes.
|
static PropertyNamingStrategy |
KEBAB_CASE
Lowercase, separated by hyphens.
|
static PropertyNamingStrategy |
LOWER_CAMEL_CASE
lower first letter, but camel case.
|
static PropertyNamingStrategy |
LOWER_CASE
All lower case.
|
static PropertyNamingStrategy |
LOWER_DOT_CASE
Lowercase, separated by dots.
|
static PropertyNamingStrategy |
SNAKE_CASE
Lowercase, separated by underscores.
|
static PropertyNamingStrategy |
UPPER_CAMEL_CASE
upper first letter, but camel case.
|
static PropertyNamingStrategy |
UPPER_CAMEL_CASE_WITH_SPACES
upper first letter, but camel case with a space between.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<PropertyNamingStrategy> |
forName(java.lang.String namingStrategy)
Return an existing naming strategy for each name.
|
java.lang.String |
translate(io.micronaut.core.annotation.AnnotatedElement element)
Translate the given name into the desired format.
|
static final PropertyNamingStrategy IDENTITY
static final PropertyNamingStrategy UPPER_CAMEL_CASE_WITH_SPACES
Foo Bar
.static final PropertyNamingStrategy LOWER_CAMEL_CASE
fooBar
.static final PropertyNamingStrategy UPPER_CAMEL_CASE
FooBar
.static final PropertyNamingStrategy SNAKE_CASE
foo_bar
.static final PropertyNamingStrategy LOWER_DOT_CASE
foo.bar
.static final PropertyNamingStrategy KEBAB_CASE
foo-bar
.static final PropertyNamingStrategy LOWER_CASE
foobar
.@NonNull java.lang.String translate(@NonNull io.micronaut.core.annotation.AnnotatedElement element)
element
- The annotated element to translatestatic java.util.Optional<PropertyNamingStrategy> forName(java.lang.String namingStrategy)
namingStrategy
- The naming strategy name.