Class StringValidator

java.lang.Object
dev.toonformat.jtoon.util.StringValidator

public final class StringValidator extends Object
Validates strings for safe unquoted usage in TOON format. Follows Object Calisthenics principles with guard clauses and single-level indentation.
  • Method Details

    • isSafeUnquoted

      public static boolean isSafeUnquoted(String value, String delimiter)
      Checks if a string can be safely written without quotes. Uses guard clauses and early returns for clarity.
      Parameters:
      value - the string value to check
      delimiter - the delimiter being used (for validation)
      Returns:
      true if the string can be safely written without quotes, false otherwise
    • isValidUnquotedKey

      public static boolean isValidUnquotedKey(String key)
      Checks if a key can be used without quotes.
      Parameters:
      key - the key to validate
      Returns:
      true if the key can be used without quotes, false otherwise