Class StringUtils
java.lang.Object
dimstyl.orm.internal.utils.StringUtils
Utility class for string transformations and formatting.
This class provides helper methods to convert strings between different naming conventions and to generate formatted representations of supported Java-to-SQL type mappings.
Design Notes:
- This class is
final
to prevent inheritance. - The constructor is private to enforce a static utility pattern.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Private constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Converts a camelCase string to snake_case.static String
Converts a string to a default name format.static String
getSupportedDataTypes
(String databaseEngine, Map<Class<?>, String> typeMap) Retrieves a formatted list of supported Java-to-SQL type mappings for a given database.
-
Constructor Details
-
StringUtils
private StringUtils()Private constructor to prevent instantiation.
-
-
Method Details
-
getDefaultName
Converts a string to a default name format.This method internally calls
camelCaseToSnakeCase(String)
.- Parameters:
s
- The input string in camelCase format.- Returns:
- The string converted to snake_case format.
-
camelCaseToSnakeCase
-
getSupportedDataTypes
Retrieves a formatted list of supported Java-to-SQL type mappings for a given database.This method generates a table-like representation of supported data types, helping users understand which Java types are mapped to SQL types.
- Parameters:
databaseEngine
- The target database engine (e.g., "H2", "SQLite").typeMap
- A map of Java types to SQL types.- Returns:
- A formatted string containing supported data type mappings.
-