Package io.sundr.utils
Class Strings
java.lang.Object
io.sundr.utils.Strings
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcapitalizeFirst(String str) static final StringRemove repeating strings that are appearing in the name.static StringdeCapitalizeFirst(String str) static Stringstatic <T> Stringstatic Stringstatic intindexOfAlphabetic(String str) static booleanisNotNullOrEmpty(String str) static booleanisNullOrEmpty(String str) static <T> Stringstatic <T> Stringstatic <T> Stringstatic <T> Stringstatic StringloadResource(String resourceName) static StringloadResource(URL resourceUrl) static final StringloadResourceQuietly(String resourceName) static final StringloadResourceQuietly(URL resourceUrl) static final StringprefixKeywords(String name) Adds an underscore to the specified String, if its a Java Keyword.static final StringtoFieldName(String name) Converts the string into a safe field name.static final StringtoPojoName(String name, String prefix, String suffix) Converts a name of an interface or abstract class to Pojo name.
-
Method Details
-
isNullOrEmpty
-
isNotNullOrEmpty
-
indexOfAlphabetic
-
capitalizeFirst
-
deCapitalizeFirst
-
join
-
join
-
join
-
join
-
getPrefix
-
getPrefix
-
loadResourceQuietly
-
loadResource
- Throws:
IOException
-
loadResourceQuietly
-
loadResource
- Throws:
IOException
-
compact
Remove repeating strings that are appearing in the name. This is done by splitting words (camel case) and using each word once.- Returns:
- The compact name.
-
prefixKeywords
Adds an underscore to the specified String, if its a Java Keyword.- Parameters:
name- The specified string.- Returns:
- The specified string if not a keyword, the string prefixed with underscore otherwise.
-
toFieldName
Converts the string into a safe field name.- Parameters:
name- The field name.- Returns:
- The safe field name.
-
toPojoName
Converts a name of an interface or abstract class to Pojo name. Remove leading "I" and "Abstract" or trailing "Interface".- Parameters:
name- The name to convert.prefix- The prefix to use if needed.suffix- The suffix to user if needed.- Returns:
- The converted name, if a conversion actually happened or the original name prefixed and suffixed otherwise.
-
indent
-