@Component
public final class BooleanUtilities
extends java.lang.Object
| Constructor and Description |
|---|
BooleanUtilities() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
convert(@NotNull java.lang.String stringBoolean)
Converts various strings to booleans, by using regex, to allow for more variations in input.
|
boolean |
readBoolean(@NotNull java.util.Scanner scanner)
Prompts the user to enter values which will then be converted to booleans, either
TRUE
or FALSE. |
public boolean readBoolean(@NotNull
@NotNull java.util.Scanner scanner)
TRUE
or FALSE. This prevents any non-boolean values from being written to the new
configuration file.scanner - Used for reading the users input.public boolean convert(@NotNull
@NotNull java.lang.String stringBoolean)
TRUE are:[Tt]rue1[Yy]es[Yy]cli.input.truecli.input.yescli.input.yes.shortFALSE are:[Ff]alse0[Nn]o[Nn]cli.input.falsecli.input.nocli.input.no.shortstringBoolean - The string which should be converted to boolean if it matches certain
patterns.