Class BooleanParser


  • public class BooleanParser
    extends Object
    Parser for strings that represent boolean values.
    Author:
    Stefan Frings, http://stefanfrings.de/javautils
    • Constructor Detail

      • BooleanParser

        public BooleanParser()
    • Method Detail

      • parse

        public static boolean parse​(String s)
                             throws NumberFormatException
        Parse a string to a boolean value.

        Valid strings are:

        • true, yes, on, 1
        • false, no, off, 0
        Parameters:
        s - The source string
        Returns:
        The boolean value of that string
        Throws:
        NumberFormatException - If the string has an invalid content.