Klasse GlobalStringHelper
java.lang.Object
ch.nolix.core.commontype.commontypehelper.GlobalStringHelper
The
GlobalStringHelper
provides methods to handle String
s. Of
the GlobalStringHelper
an instance cannot be created.- Autor:
- Silvan Wyss
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic String
createStringWithLength
(String string, int length) static String
createStringWithoutLastCharacters
(String string, int n) static String
createTabulators
(int tabulatorCount) static String
getInBraces
(String string) static String
getInParantheses
(String string) static String
getInQuotes
(String string) static boolean
isLowerCase
(String string) static boolean
isPascalCase
(String string) static boolean
startsWithIgnoringCase
(String string, String prefix) static boolean
static double
static String
toPascalCase
(String string) static String
toUpperSnakeCase
(String string)
-
Methodendetails
-
createStringWithLength
- Parameter:
string
-length
-- Gibt zurück:
- a new
String
that is the given string extended to the given length with spaces. - Löst aus:
ArgumentIsNullException
- if the given string is null.NegativeArgumentException
- if the given length is negative.InvalidArgumentException
- if the given string is longer than the given length.
-
createStringWithoutLastCharacters
- Parameter:
string
-n
-- Gibt zurück:
- a new
String
that is like the given string without the last n characters.
-
createTabulators
- Parameter:
tabulatorCount
-- Gibt zurück:
- a new
String
consisting of as many tabulators as the given tabulatorCount says. - Löst aus:
NegativeArgumentException
- if the given tabulatorCount is negative.
-
getInBraces
- Parameter:
string
-- Gibt zurück:
- the given string in braces.
- Löst aus:
ArgumentIsNullException
- if the given string is null.
-
getInParantheses
- Parameter:
string
-- Gibt zurück:
- the given string in parentheses.
- Löst aus:
ArgumentIsNullException
- if the given string is null.
-
getInQuotes
- Parameter:
string
-- Gibt zurück:
- the given string in quotes
- Löst aus:
ArgumentIsNullException
- if the given string is null.
-
isLowerCase
- Parameter:
string
-- Gibt zurück:
- true if the given string is in lower case.
-
isPascalCase
- Parameter:
string
-- Gibt zurück:
- true if the given string is in pascal case.
-
startsWithIgnoringCase
- Parameter:
string
-prefix
-- Gibt zurück:
- true if the given string starts with the given prefix ignoring case.
-
toBoolean
- Parameter:
string
-- Gibt zurück:
- the boolean the given string represents.
- Löst aus:
InvalidArgumentException
- if the given string does not represent a boolean.
-
toDouble
- Parameter:
string
-- Gibt zurück:
- the double the given string represents.
- Löst aus:
InvalidArgumentException
- if the given string does not represent a double.
-
toPascalCase
- Parameter:
string
-- Gibt zurück:
- a new
String
in pascal case for the given string.
-
toUpperSnakeCase
- Parameter:
string
-- Gibt zurück:
- a new
String
in capital snake case for the given string.
-