Package org.immutables.encode
Annotation Type Encoding.Naming
- Enclosing class:
Encoding
Many 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:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSet totrueif depluralizer needs to kick in and try to convert attribute name to a singular form before applying pattern (value()).Standard namings can be used to reuse standard styles, like the ones defined inValue.Immutable.Stylefor the custom-defined elements in encoding.Naming pattern for element.
-
Element Details
-
value
String valueNaming pattern for element.- Returns:
- naming pattern
- Default:
"*"
-
depluralize
boolean depluralizeSet 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 standardStandard 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:
NONE
-