Java Boolean Parse tryParseBoolean(String value)

Here you can find the source of tryParseBoolean(String value)

Description

Returns whether or not the String can be parsed as an Boolean

License

Open Source License

Declaration

public static boolean tryParseBoolean(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/* w  w  w  .java 2 s .c o m*/
     * Returns whether or not the String can be parsed as an Boolean
     */
    public static boolean tryParseBoolean(String value) {
        return value.equals("true") || value.equals("false");
    }
}

Related

  1. tryParseBool(Object obj, Boolean defaultVal)
  2. tryParseBool(String value)
  3. tryParseBoolean(String value)