package org.ovirt.engine.api.utils;

/**
 * This class contains methods that parse boolean from strings accepting only the values {@code true} and {@code false}.
 */
public class BooleanParser {
    public static boolean parseBoolean(String value) {
        if ("true".equalsIgnoreCase(value)) {
            return true;
        }
        if ("false".equalsIgnoreCase(value)) {
            return false;
        }
        throw new InvalidValueException(
            "Value \"" + value + "\" isn't a valid boolean, it should be \"true\" or \"false\""
        );
    }
}

@@ -139,27 +139,182 @@
 rue%7D
- and %7B@code false%7D.
+, %7B@code false%7D,%0A * %7B@code 0%7D and %7B@code 1%7D as described in %3Ca href=%22http://www.w3.org/TR/xmlschema-2/#boolean%22%3Esection 3.2.2.1%3C/a%3E of%0A * the XML schema specification %7B@link%7D
 %0A */
@@ -432,32 +432,53 @@
 gnoreCase(value)
+ %7C%7C %221%22.equals(value)
 ) %7B%0A            
@@ -539,24 +539,45 @@
 eCase(value)
+ %7C%7C %220%22.equals(value)
 ) %7B%0A        
@@ -727,18 +727,17 @@
 %22true%5C%22 
-or
+,
  %5C%22false
@@ -738,16 +738,32 @@
 %22false%5C%22
+, %5C%220%5C%22 or %5C%221%5C%22
 %22%0A      

Accept 0 and 1 for boolean values