Class BooleanParser

java.lang.Object
de.stefanfrings.utils.BooleanParser

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

    • BooleanParser

      public BooleanParser()
  • Method Details

    • parse

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

      Valid strings, not case-sensitive:

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