Package org.apache.camel.tooling.util
Class Strings
java.lang.Object
org.apache.camel.tooling.util.Strings
Some String helper methods
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns the string after the given tokenstatic StringCapitalizes the name as a titlestatic Stringstatic StringClips the text between the start and end markersstatic StringcamelCaseToDash(String text) Converts the string from camel case into dash format (helloGreatWorld -> hello-great-world)static StringcamelDashToTitle(String value) Converts the value to use title style instead of dash casedstatic StringcanonicalClassName(String className) Returns the canonical class name by removing any generic type information.static Stringcapitalize(String text) A simpler version of StringHelper#capitlize for usage in the tooling codestatic StringdoubleQuote(String text) Returns the text wrapped double quotesstatic StringReturns the value or the defaultValue if it is nullstatic StringindentCollection(String indent, Collection<String> list) static booleanstatic booleanisNullOrEmpty(String text) Returns true if the given text is null or empty string or has null as the valuestatic StringWraps the text in the given quote textstatic Stringstatic StringsingleQuote(String text) Returns the text wrapped single quotes
-
Method Details
-
isEmpty
-
isNullOrEmpty
Returns true if the given text is null or empty string or has null as the value -
safeNull
-
getOrElse
Returns the value or the defaultValue if it is null -
after
Returns the string after the given token- Parameters:
text- the textafter- the token- Returns:
- the text after the token, or null if text does not contain the token
-
canonicalClassName
Returns the canonical class name by removing any generic type information. -
doubleQuote
Returns the text wrapped double quotes -
singleQuote
Returns the text wrapped single quotes -
quote
Wraps the text in the given quote text- Parameters:
text- the text to wrap in quotesquote- the quote text added to the prefix and postfix of the text- Returns:
- the text wrapped in the given quotes
-
between
Clips the text between the start and end markers -
asTitle
Capitalizes the name as a title- Parameters:
name- the name- Returns:
- as a title
-
before
-
indentCollection
-
camelDashToTitle
Converts the value to use title style instead of dash cased -
camelCaseToDash
Converts the string from camel case into dash format (helloGreatWorld -> hello-great-world)- Parameters:
text- the string- Returns:
- the string camel cased
-
capitalize
A simpler version of StringHelper#capitlize for usage in the tooling code- Parameters:
text- the string- Returns:
- the string capitalized (upper case first character) or null if the input is null
-