java.lang.Object
com.github.muehmar.gradle.openapi.generator.java.model.name.JavaName

public class JavaName extends Object
Name for Java identifiers, like member, method or classnames. A JavaName can be constructed from any string and gets escaped to conform to the specification for identifiers. Render the name as string with asString() or toString() will result in the escaped string.

Any operation like prefix(String) is performed on the original string rather than on the escaped string. This will produce identifiers which are as close as possible to the original name, i.e. only do escaping if necessary. E.g. if a Java keyword is used as name and gets prefixed, there is no longer the need to escape it.
  • Method Details

    • fromName

      public static JavaName fromName(Name name)
    • fromString

      public static JavaName fromString(String name)
    • prefix

      public JavaName prefix(String prefix)
    • append

      public JavaName append(String append)
    • startUpperCase

      public JavaName startUpperCase()
    • startLowerCase

      public JavaName startLowerCase()
    • prefixedMethodName

      public JavaName prefixedMethodName(String prefix)
    • wordBoundaryPattern

      public String wordBoundaryPattern()
    • getOriginalName

      public Name getOriginalName()
    • asString

      public String asString()
    • toString

      public String toString()
      Overrides:
      toString in class Object