Package io.jmix.dynattr.utils
Class DynAttrStringUtils
java.lang.Object
io.jmix.dynattr.utils.DynAttrStringUtils
Utility class for manipulating strings in various case formats.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isCamelCase
(String str) Checks if a string is in camelCase format.static boolean
isPascalCase
(String str) Checks if a string is in PascalCase format.static String
toCamelCase
(String str, char... delimiters) Converts a string to camelCase format.
-
Field Details
-
CAMEL_CASE_REGEXP
Regular expression for matching camelCase strings.- See Also:
-
PASCAL_CASE_REGEXP
Regular expression for matching PascalCase strings.- See Also:
-
-
Method Details
-
toCamelCase
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
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
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.
-