Java Boolean to Int boolean2int(String tmp)

Here you can find the source of boolean2int(String tmp)

Description

booleanint

License

Apache License

Declaration

public static int boolean2int(String tmp) 

Method Source Code

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

public class Main {
    public static final int TRUE = 1;
    public static final int FALSE = 2;

    public static int boolean2int(String tmp) {
        if (tmp != null && Boolean.valueOf(tmp)) {
            return TRUE;
        }/*w ww .  j a  va2s .c  o m*/
        return FALSE;
    }

    public static int boolean2int(Boolean tmp) {
        if (tmp != null && tmp) {
            return TRUE;
        }
        return FALSE;
    }
}

Related

  1. booleanToInt(boolean[] values)
  2. booleanToint(final boolean value)
  3. booleanToInteger(boolean b)
  4. BooleanToInteger(boolean thisbool)