Enum NameCaseConvention

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      LOWER_CAMEL
      Camel case with the first letter lowercase, e.g., "lowerCamel".
      LOWER_HYPHEN
      Lowercase and hyphen-separated, e.g., "lower-hyphen".
      LOWER_UNDERSCORE
      Lowercase and underscore-separated, e.g., "lower_underscore".
      UPPER_CAMEL
      Camel case with the first letter uppercase, e.g., "UpperCamel".
      UPPER_UNDERSCORE
      Underscore separated with all letters uppercase, e.g., "UPPER_UNDERSCORE".
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equalsRelaxedBinding​(java.lang.String str0, java.lang.String str1)
      Check equality between two inputs using "relaxed binding" rules.
      java.lang.String format​(java.lang.String str)
      Formats the input to the style of this NameCaseConvention.
      static java.lang.String format​(NameCaseConvention convention, java.lang.String str)  
      boolean matches​(java.lang.String str)
      Whether the input matches the formatting style of this NameCaseConvention.
      static boolean matches​(NameCaseConvention convention, java.lang.String str)  
      static NameCaseConvention valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NameCaseConvention[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LOWER_HYPHEN

        public static final NameCaseConvention LOWER_HYPHEN
        Lowercase and hyphen-separated, e.g., "lower-hyphen". This is also known as "kebab-case".
      • LOWER_UNDERSCORE

        public static final NameCaseConvention LOWER_UNDERSCORE
        Lowercase and underscore-separated, e.g., "lower_underscore". This is also known as "snake_case".
      • LOWER_CAMEL

        public static final NameCaseConvention LOWER_CAMEL
        Camel case with the first letter lowercase, e.g., "lowerCamel". This is the standard Java variable naming convention.
      • UPPER_CAMEL

        public static final NameCaseConvention UPPER_CAMEL
        Camel case with the first letter uppercase, e.g., "UpperCamel". This is the standard Java and C++ class naming convention.
      • UPPER_UNDERSCORE

        public static final NameCaseConvention UPPER_UNDERSCORE
        Underscore separated with all letters uppercase, e.g., "UPPER_UNDERSCORE". This is the standard Java and C++ constant variable naming convention. This is also known as "SCREAMING_SNAKE_CASE".
    • Method Detail

      • values

        public static NameCaseConvention[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NameCaseConvention c : NameCaseConvention.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NameCaseConvention valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • format

        public java.lang.String format​(java.lang.String str)
        Formats the input to the style of this NameCaseConvention.
        Parameters:
        str - The input string to format.
        Returns:
        The string formatted to the style of this convention.
      • format

        public static java.lang.String format​(NameCaseConvention convention,
                                              java.lang.String str)
      • matches

        public boolean matches​(java.lang.String str)
        Whether the input matches the formatting style of this NameCaseConvention.
        Parameters:
        str - The input string to check.
        Returns:
        Whether the input matches the formatting style of this convention.
      • matches

        public static boolean matches​(NameCaseConvention convention,
                                      java.lang.String str)
      • equalsRelaxedBinding

        public static boolean equalsRelaxedBinding​(java.lang.String str0,
                                                   java.lang.String str1)
        Check equality between two inputs using "relaxed binding" rules. The inputs will be converted to LOWER_CAMEL before being checked using String.equals(java.lang.Object).
        Parameters:
        str0 - The first input to compare.
        str1 - The second input to compare.
        Returns:
        Whether the inputs are equal.
        See Also:
        Micronaut Property Value Binding Normalization, Spring Boot Relaxed Binding