Java Boolean Value From booleanValue(String tfString)

Here you can find the source of booleanValue(String tfString)

Description

boolean Value

License

MIT License

Declaration

public static boolean booleanValue(String tfString) 

Method Source Code

//package com.java2s;
/*//from  w w w  .java 2s  .  c  o m
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */

public class Main {
    public static boolean booleanValue(String tfString) {
        String trimmed = tfString.trim().toLowerCase();
        return trimmed.equals("true") || trimmed.equals("t");
    }

    public static String toLowerCase(String str) {
        return str == null ? null : str.toLowerCase();
    }

    public static boolean equals(String str1, String str2) {
        if (str1 == null) {
            if (str2 != null) {
                return false;
            }
        } else if (!str1.equals(str2)) {
            return false;
        }

        return true;
    }
}

Related

  1. booleanValue(String s)
  2. booleanValue(String s)
  3. booleanValue(String s)
  4. booleanValue(String s)
  5. booleanValue(String stringValue)
  6. booleanValue(String tfString)
  7. booleanValue(String tfString)
  8. booleanValueOf(boolean b)
  9. booleanValueOf(Object obj)