Module uk.autores

Class IdiomaticNamer

java.lang.Object
uk.autores.naming.Namer
uk.autores.naming.IdiomaticNamer

public final class IdiomaticNamer extends Namer
Generates names that conform to Java naming conventions. This implementation is more likely to generate name collisions than Namer. Case handling uses Locale.ENGLISH.
  • Constructor Details

    • IdiomaticNamer

      public IdiomaticNamer()
      Public no-args constructor as per contract.
  • Method Details

    • nameMember

      public String nameMember(String src)
      For input "foo-bar-baz" returns "fooBarBaz".
      Overrides:
      nameMember in class Namer
      Parameters:
      src - source string
      Returns:
      lower snake case
    • nameConstant

      public String nameConstant(String src)
      For input "foo-bar-baz" returns "FOO_BAR_BAZ".
      Overrides:
      nameConstant in class Namer
      Parameters:
      src - source string
      Returns:
      upper snake case
    • nameType

      public String nameType(String src)
      For input "foo-bar-baz" returns "FooBarBaz".
      Overrides:
      nameType in class Namer
      Parameters:
      src - source string
      Returns:
      upper camel case