Object BooleanUtilities.Companion
-
- All Implemented Interfaces:
public class BooleanUtilities.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static BooleanUtilities.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final BooleanreadBoolean()Prompts the user to enter values which will then be converted to booleans, either TRUEorFALSE.final Booleanconvert(String stringBoolean)Converts various strings to booleans, by using regex, to allow for more variations in input. -
-
Method Detail
-
readBoolean
final Boolean readBoolean()
Prompts the user to enter values which will then be converted to booleans, either
TRUEorFALSE. This prevents any non-boolean values from being written to the new configuration file.- Returns:
True or False, depending on user input.
-
convert
final Boolean convert(String stringBoolean)
Converts various strings to booleans, by using regex, to allow for more variations in input.
Converted to
TRUEare:[Tt]rue1[Yy]es[Yy]Language Key
cli.input.trueLanguage Key
cli.input.yesLanguage Key
cli.input.yes.short
Converted to
FALSEare:[Ff]alse0[Nn]o[Nn]Language Key
cli.input.falseLanguage Key
cli.input.noLanguage Key
cli.input.no.short
- Parameters:
stringBoolean- The string which should be converted to boolean if it matches certain patterns.- Returns:
Returns the corresponding boolean if match with pattern was found. If no match is found, assume and return false.
-
-
-
-