Package com.saperion.util
Class BoolConverter
java.lang.Object
com.saperion.util.BoolConverter
Converts Strings to booleans and vice versa.
- Author:
- chg
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertBoolToString
(boolean booleanToString) Converts a boolean into a string "0" or "1".static boolean
convertStringToBool
(String stringToBool) Converts a string into the corresponding boolean primitive true or false.
-
Method Details
-
convertStringToBool
Converts a string into the corresponding boolean primitive true or false.- Parameters:
stringToBool
- String representation of a boolean. Allowed is "0" or "1".- Returns:
- true if stringToBoolean is "1", false if stringToBoolean is "0", IllegalStateException else.
-
convertBoolToString
Converts a boolean into a string "0" or "1".- Parameters:
booleanToString
- boolean value to convert to String "0" or "1".- Returns:
- "0" if false, "1" if true.
-