Class StringUtils

java.lang.Object
dimstyl.orm.internal.utils.StringUtils

public final class StringUtils extends Object
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 Details

    • StringUtils

      private StringUtils()
      Private constructor to prevent instantiation.
  • Method Details

    • getDefaultName

      public static String getDefaultName(String s)
      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

      public static String camelCaseToSnakeCase(String s)
      Converts a camelCase string to snake_case.

      If the input string is null or blank, it is returned as-is.

      Parameters:
      s - The input string in camelCase format.
      Returns:
      The string converted to snake_case format.
    • getSupportedDataTypes

      public static String getSupportedDataTypes(String databaseEngine, Map<Class<?>,String> typeMap)
      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.