Java Integer Create toInteger(boolean bool)

Here you can find the source of toInteger(boolean bool)

Description

to Integer

License

Mozilla Public License

Declaration

public static int toInteger(boolean bool) 

Method Source Code

//package com.java2s;
//License from project: Mozilla Public License 

public class Main {
    public static int toInteger(boolean bool) {
        return bool ? 1 : 0;
    }/* w  ww . j ava2s .c om*/

    public static int toInteger(boolean bool, int trueValue, int falseValue) {
        return bool ? trueValue : falseValue;
    }

    public static int toInteger(Boolean bool, int trueValue, int falseValue, int nullValue) {
        if (bool == null) {
            return nullValue;
        }

        return bool ? trueValue : falseValue;
    }
}

Related

  1. toIntBigEndian(byte[] input)
  2. toIntDecoded(String s)
  3. toIntDefaultIfNull(Integer configured, int theDefault)
  4. toInteger(boolean b)
  5. toInteger(boolean bool)
  6. toInteger(boolean bool)
  7. toInteger(byte b1, byte b2, byte b3, byte b4)
  8. toInteger(byte[] b)
  9. toInteger(byte[] b)