Java Boolean to Int convertBooleanToInteger(Boolean booleanToConvert)

Here you can find the source of convertBooleanToInteger(Boolean booleanToConvert)

Description

Converts a boolean value to the corresponding integer value, 0 for false and 1 for true.

License

Apache License

Parameter

Parameter Description
booleanToConvert the boolean value to convert

Return

0 for false and 1 for true

Declaration

public static Integer convertBooleanToInteger(Boolean booleanToConvert) 

Method Source Code

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

public class Main {
    /**/*from   ww w.j  a  v a2 s . co m*/
     * Converts a boolean value to the corresponding integer value, 0 for false
     * and 1 for true.
     *
     * @param booleanToConvert the boolean value to convert
     * @return 0 for false and 1 for true
     */
    public static Integer convertBooleanToInteger(Boolean booleanToConvert) {
        return booleanToConvert ? 1 : 0;
    }
}

Related

  1. boolToInt(boolean bool)
  2. BoolToInt(boolean Expression)
  3. boolToInt(Boolean[] bools_in)
  4. convertBooleanToInt(boolean aValue)
  5. convertBooleanToInt(boolean bool)