Interface IStringTool
- All Known Implementing Classes:
StringToolUnit
public interface IStringTool
The
IStringTool provides methods to handle Strings.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptioncreateStringWithoutLastCharacters(String string, int n) createTabs(int tabCount) getInBraces(Object object) getInParentheses(Object... objects) getInSingleQuotes(Object object) booleantoCapitalSnakeCase(String string) doubletoPascalCase(String string) doubletoProportion(String string)
-
Method Details
-
createStringWithoutLastCharacters
-
createTabs
- Parameters:
tabCount-- Returns:
- a new
Stringconsisting of as many tabulators as the given tabCount says. - Throws:
RuntimeException- if the given tabCount is negative.
-
getInBraces
- Parameters:
object-- Returns:
- the
Stringrepresentation of the given object in braces. - Throws:
RuntimeException- if the given object is null.
-
getInParentheses
- Parameters:
objects-- Returns:
- the
Stringrepresentation of the given objects in parentheses. - Throws:
RuntimeException- if the given objects is null.RuntimeException- if one of the given objects is null.
-
getInSingleQuotes
- Parameters:
object-- Returns:
- the
Stringrepresentation of the given object in single quotes. - Throws:
RuntimeException- if the given object is null.
-
toBoolean
- Parameters:
string-- Returns:
- the boolean the given string represents.
- Throws:
RuntimeException- if the given string does not represent a boolean.
-
toCapitalSnakeCase
-
toDouble
- Parameters:
string-- Returns:
- the double the given string represents.
- Throws:
RuntimeException- if the given string does not represent a double.
-
toPascalCase
-
toProportion
- Parameters:
string-- Returns:
- a proportion in [0, 1] from the given string.
- Throws:
RuntimeException- if the given string does not represent a proportion.
-