Skip to content

NamingStrategies

Thomas Deutsch edited this page Nov 4, 2018 · 2 revisions

Naming Strategies

Will be used to convert values. They can be used to adjust conversion of

  1. enum constants
  2. field names in the enum
  • All usable strategies are defined in com.tcmj.pug.enums.api.tools.NamingStrategyFactory
  • You should also have a look to the unit tests in com.tcmj.pug.enums.api.tools.NamingStrategyFactoryTest
Name Description Example
camel Camel case changing only the first letter 'lowered Camel UPPERED' will be 'LoweredCamelUPPERED'
camelStrict each character after the first uppered one will be strictly lowered 'lowered Camel UPPERED' will be 'LoweredCamelUppered'
extractParenthesis values in parenthesis will be prefixed 'Congo (Democratic Republic of the)' will be 'Democratic Republic of the Congo'
flattenGermanUmlauts todo todo
harmonize Amazing strategy which converts special characters (eg.: circumflex, acute, grave, ..) to its latin derivative 'États-Unis d'Amérique' will be 'EtatsUnisdAmerique'
lowerCase all to lowercase 'hans' will be 'HANS'
lowerCaseFirstLetter todo todo
minus2underline todo todo
removeDots remove '.' characters todo
removeProhibitedSpecials todo todo
removeSpaces remove ' ' characters todo
replaceAtoZ todo todo
space2underline convert spaces to underlines todo
trim using String.trim() on the value todo
upperCase all to uppercase 'hans' will be 'HANS'
Clone this wiki locally