Java Integer Create toInt(final Boolean value)

Here you can find the source of toInt(final Boolean value)

Description

To int.

License

Open Source License

Parameter

Parameter Description
value the value

Return

the int

Declaration

public static int toInt(final Boolean value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** The Constant FALSE_INT. */
    public static final int FALSE_INT = 0;
    /** The Constant TRUE_INT. */
    public static final int TRUE_INT = 1;

    /**//from   w w  w .ja  va  2 s.  co m
     * To int.
     *
     * @param value
     *            the value
     * @return the int
     */
    public static int toInt(final Boolean value) {
        if (value == null) {
            return FALSE_INT;
        }
        return toInt(value.booleanValue());
    }

    /**
     * To int.
     *
     * @param value
     *            the value
     * @return the int
     */
    public static int toInt(final boolean value) {
        if (value) {
            return TRUE_INT;
        }
        return FALSE_INT;
    }
}

Related

  1. toInt(double[] array)
  2. toInt(double[] layer)
  3. toInt(double[] v)
  4. toInt(double[][] data)
  5. toInt(double[][] doubles)
  6. toInt(final byte b)
  7. toInt(final byte b)
  8. toInt(final byte[] buffer, final int offset, final int length)
  9. toInt(final byte[] bytes, final int offset)