Object BooleanUtilities.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Boolean readBoolean() Prompts the user to enter values which will then be converted to booleans, either TRUE or FALSE.
      final Boolean convert(String stringBoolean) Converts various strings to booleans, by using regex, to allow for more variations in input.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • readBoolean

         final Boolean readBoolean()

        Prompts the user to enter values which will then be converted to booleans, either TRUE or FALSE. 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 TRUE are:

        • [Tt]rue

        • 1

        • [Yy]es

        • [Yy]

        • Language Key cli.input.true

        • Language Key cli.input.yes

        • Language Key cli.input.yes.short

        Converted to FALSE are:

        • [Ff]alse

        • 0

        • [Nn]o

        • [Nn]

        • Language Key cli.input.false

        • Language Key cli.input.no

        • Language 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.