Package net.apartium.cocoabeans
Class StringHelpers
java.lang.Object
net.apartium.cocoabeans.StringHelpers
A class consisting of string utility methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisNullOrEmpty(String arg) Checks if given string is null or empty.static OptionalDoubleparseDouble(String arg) Attempts to parse given string arg as a number.static OptionalFloatparseFloat(String arg) Attempts to parse given string arg as a number.static OptionalIntparseInteger(String arg) Attempts to parse given string arg as a number.static OptionalLongAttempts to parse given string arg as a number.
-
Constructor Details
-
StringHelpers
public StringHelpers()
-
-
Method Details
-
parseInteger
Attempts to parse given string arg as a number.- Parameters:
arg- string argument- Returns:
- empty if parsing was not successful, otherwise resulting number boxed with option
-
parseDouble
Attempts to parse given string arg as a number.- Parameters:
arg- string argument- Returns:
- empty if parsing was not successful, otherwise resulting number boxed with option
-
parseFloat
Attempts to parse given string arg as a number.- Parameters:
arg- string argument- Returns:
- empty if parsing was not successful, otherwise resulting number boxed with option
-
parseLong
Attempts to parse given string arg as a number.- Parameters:
arg- string argument- Returns:
- empty if parsing was not successful, otherwise resulting number boxed with option
-
isNullOrEmpty
Checks if given string is null or empty.- Parameters:
arg- given string- Returns:
- true if null or empty, else false
-