public final class UnderscoreFieldNameConverter extends AbstractFieldNameConverter
Imposes an underscore word-separation convention upon field names. This will convert field in the following way:
| Method Name | Returns Entity? | Field Name |
| getFirstName | false |
first_name |
| setLastName | false |
last_name |
| getCompany | true |
company_id |
| isCool | false |
cool |
This converter allows for both all-lowercase and all-uppercase
field name conventions. For example, depending on the configuration,
getLastName may convert to "LAST_NAME".
This converter is all that is required to emulate the ActiveRecord field name conversion.
| Constructor and Description |
|---|
UnderscoreFieldNameConverter(Case fieldNameCase)
Creates a new field name converter in which all field names will
be either fully uppercase or fully lowercase.
|
UnderscoreFieldNameConverter(Case fieldNameCase,
List<FieldNameResolver> fieldNameResolvers) |
| Modifier and Type | Method and Description |
|---|---|
String |
convertName(String name) |
getName, getPolyTypeNamepublic UnderscoreFieldNameConverter(Case fieldNameCase)
fieldNameCase - the case to use for field namespublic UnderscoreFieldNameConverter(Case fieldNameCase, List<FieldNameResolver> fieldNameResolvers)
public String convertName(String name)
convertName in interface FieldNameProcessorconvertName in class AbstractFieldNameConverterCopyright © 2007–2021 Atlassian. All rights reserved.