Package org.immutables.encode
Annotation Type Encoding.Naming
-
@Target(METHOD) @Retention(SOURCE) public static @interface Encoding.NamingMany elements (but not all) supports customized naming patterns. Use single asterisk symbol in a name to denote a placeholder where attribute name would be insterted. We call namings of form"*"as identity naming, and the ones which have no placeholder, as in"set"- constant namings. Like "with*Added" for copy with addition method. Elements that can have customized naming:- Copy/With methods
- Helper fields and methods
- Builder attribute initializer
- Helper fields and methods on builder
As an alternative to specifying a pattern, you may want to reuse
standard()naming.Please note, that with customized naming it is possible (but in general, not recommended) to put constant naming (without
"*"placeholder) on elements. But when you do this it can result in name clashes in generated code.- See Also:
depluralize(),standard()
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleandepluralizeSet totrueif depluralizer needs to kick in and try to convert attribute name to a singular form before applying pattern (value()).Encoding.StandardNamingstandardStandard namings can be used to reuse standard styles, like the ones defined inValue.Immutable.Stylefor the custom-defined elements in encoding.java.lang.StringvalueNaming pattern for element.
-
-
-
-
depluralize
boolean depluralize
Set totrueif depluralizer needs to kick in and try to convert attribute name to a singular form before applying pattern (value()). Some standard namings imply depluralization (Encoding.StandardNaming.ADD,Encoding.StandardNaming.PUT).- Returns:
- if depluralized attribute name
- Default:
- false
-
-
-
standard
Encoding.StandardNaming standard
Standard namings can be used to reuse standard styles, like the ones defined inValue.Immutable.Stylefor the custom-defined elements in encoding. IfEncoding.StandardNamingis used with the generator other than Immutables which do not have notion of namings/styles, then, typical default values will be used.- Default:
- org.immutables.encode.Encoding.StandardNaming.NONE
-
-