@Component
public final class BooleanUtilities
extends java.lang.Object
| Constructor and Description |
|---|
BooleanUtilities() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
convert(java.lang.String stringBoolean)
Converts various strings to booleans, by using regex, to allow for more variations in input.
|
boolean |
readBoolean()
Deprecated.
Will be removed in Milestone 4. Use
readBoolean(Scanner) instead. |
boolean |
readBoolean(java.util.Scanner scanner)
Prompts the user to enter values which will then be converted to booleans, either
TRUE
or FALSE. |
@Deprecated public boolean readBoolean()
readBoolean(Scanner) instead.TRUE
or FALSE. This prevents any non-boolean values from being written to the new
configuration file.public boolean readBoolean(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(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.