Class BoolConverter


  • public final class BoolConverter
    extends java.lang.Object
    Converts Strings to booleans and vice versa.
    Author:
    chg
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String convertBoolToString​(boolean booleanToString)
      Converts a boolean into a string "0" or "1".
      static boolean convertStringToBool​(java.lang.String stringToBool)
      Converts a string into the corresponding boolean primitive true or false.
      • Methods inherited from class java.lang.Object

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

      • convertStringToBool

        public static boolean convertStringToBool​(java.lang.String stringToBool)
        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

        public static java.lang.String convertBoolToString​(boolean booleanToString)
        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.