Java Boolean Parse tryParseBoolean(String value)

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

Description

try Parse Boolean

License

Apache License

Declaration

public static Boolean tryParseBoolean(String value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static Boolean tryParseBoolean(String value) {
        if (value == null) {
            return null;
        }/*from  w w  w.  j  a  va 2 s  .  c  o  m*/
        if (value.equalsIgnoreCase("true")) {
            return true;
        } else if (value.equalsIgnoreCase("false")) {
            return false;
        }
        return null;
    }
}

Related

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