Enum Class StringConvention

java.lang.Object
java.lang.Enum<StringConvention>
io.micronaut.core.naming.conventions.StringConvention
All Implemented Interfaces:
Serializable, Comparable<StringConvention>, Constable

public enum StringConvention extends Enum<StringConvention>
An enum representing different conventions.
Since:
1.0
Author:
graemerocher
  • Enum Constant Details

    • CAMEL_CASE_CAPITALIZED

      public static final StringConvention CAMEL_CASE_CAPITALIZED
      Camel case capitalized like class names. Example: FooBar
    • CAMEL_CASE

      public static final StringConvention CAMEL_CASE
      Camel case, lower case first letter. Example: fooBar
    • HYPHENATED

      public static final StringConvention HYPHENATED
      Hyphenated, in lower case. Example foo-bar
    • RAW

      public static final StringConvention RAW
      Raw unconverted string.
    • UNDER_SCORE_SEPARATED

      public static final StringConvention UNDER_SCORE_SEPARATED
      Hyphenated, in upper case. Example FOO_BAR
    • UNDER_SCORE_SEPARATED_LOWER_CASE

      public static final StringConvention UNDER_SCORE_SEPARATED_LOWER_CASE
      Hyphenated, in lower case. Example foo_bar
  • Method Details

    • values

      public static StringConvention[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StringConvention valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • format

      public String format(String str)
      Format the string with this format.
      Parameters:
      str - The string
      Returns:
      The formatted string
    • format

      public static String format(StringConvention convention, String str)
      Format a string according to a convention.
      Parameters:
      convention - The string convention to use
      str - The string to format
      Returns:
      The formatted string based on the convention