@Documented @Retention(value=RUNTIME) @Target(value={TYPE,ANNOTATION_TYPE,FIELD}) @Inherited public @interface AccessorsStyle
@AccessorsStyle(readPrefixes = {""}, writePrefixes = {""}) public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } public String name() { return this.name; } public void name(String name) { this.name = name; } public int age() { return this.age; } public void age(int age) { this.age = age; } }
Defining the readPrefixes
and writePrefixes
as empty strings makes Micronaut aware of those accessors.
It is also possible to annotate fields with this annotation but the usage is only limited when using it with @ConfigurationBuilder.
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_READ_PREFIX
The default read prefix.
|
static String |
DEFAULT_WRITE_PREFIX
The default write prefix.
|
Modifier and Type | Optional Element and Description |
---|---|
String[] |
readPrefixes |
String[] |
writePrefixes |
public static final String DEFAULT_READ_PREFIX
public static final String DEFAULT_WRITE_PREFIX
public abstract String[] readPrefixes
public abstract String[] writePrefixes