Class StringValidator
java.lang.Object
dev.toonformat.jtoon.util.StringValidator
Validates strings for safe unquoted usage in TOON format.
Follows Object Calisthenics principles with guard clauses and single-level
indentation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSafeUnquoted(String value, String delimiter) Checks if a string can be safely written without quotes.static booleanisValidUnquotedKey(String key) Checks if a key can be used without quotes.
-
Method Details
-
isSafeUnquoted
Checks if a string can be safely written without quotes. Uses guard clauses and early returns for clarity.- Parameters:
value- the string value to checkdelimiter- the delimiter being used (for validation)- Returns:
- true if the string can be safely written without quotes, false otherwise
-
isValidUnquotedKey
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
-