Class DynAttrStringUtils

java.lang.Object
io.jmix.dynattr.utils.DynAttrStringUtils

public final class DynAttrStringUtils extends Object
Utility class for manipulating strings in various case formats.
  • Field Details

    • CAMEL_CASE_REGEXP

      public static final String CAMEL_CASE_REGEXP
      Regular expression for matching camelCase strings.
      See Also:
    • PASCAL_CASE_REGEXP

      public static final String PASCAL_CASE_REGEXP
      Regular expression for matching PascalCase strings.
      See Also:
  • Method Details

    • toCamelCase

      public static String toCamelCase(String str, char... delimiters)
      Converts a string to camelCase format.

      This method ensures that the camelCase or PascalCase format is preserved when transforming a string into camelCase. For example, 'camelCase' will not be transformed into 'camelcase'.

      This method is designed to prevent unintentional conversion of camelCase or PascalCase strings into lowercase. It is recommended for cases where maintaining the original case is crucial.

      Parameters:
      str - The input string to convert.
      delimiters - Optional delimiters for splitting the input string.
      Returns:
      The input string converted to camelCase format.
    • isCamelCase

      public static boolean isCamelCase(String str)
      Checks if a string is in camelCase format.
      Parameters:
      str - The input string to check.
      Returns:
      true if the input string is in camelCase format, false otherwise.
    • isPascalCase

      public static boolean isPascalCase(String str)
      Checks if a string is in PascalCase format.
      Parameters:
      str - The input string to check.
      Returns:
      true if the input string is in PascalCase format, false otherwise.