Java Code Examples for org.apache.commons.lang.math.NumberUtils#INTEGER_ZERO
The following examples show how to use
org.apache.commons.lang.math.NumberUtils#INTEGER_ZERO .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Elixir_0014_s.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 2
Source File: Elixir_0014_t.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 3
Source File: Arja_0020_s.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 4
Source File: Lang_51_BooleanUtils_t.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 5
Source File: BooleanUtils.java From astor with GNU General Public License v2.0 | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 6
Source File: Arja_0072_s.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 7
Source File: BooleanUtils.java From astor with GNU General Public License v2.0 | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 8
Source File: Arja_0072_t.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 9
Source File: Nopol2015_003_s.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 10
Source File: Nopol2017_0059_t.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 11
Source File: Nopol2015_003_t.java From coming with MIT License | 3 votes |
/** * <p>Converts a Boolean to a Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <p><code>null</code> will be converted to <code>null</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(Boolean.TRUE) = new Integer(1) * BooleanUtils.toIntegerObject(Boolean.FALSE) = new Integer(0) * </pre> * * @param bool the Boolean to convert * @return one if Boolean.TRUE, zero if Boolean.FALSE, <code>null</code> if <code>null</code> */ public static Integer toIntegerObject(Boolean bool) { if (bool == null) { return null; } return bool.booleanValue() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 12
Source File: Nopol2015_003_s.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 13
Source File: BooleanUtils.java From astor with GNU General Public License v2.0 | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 14
Source File: BooleanUtils.java From astor with GNU General Public License v2.0 | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 15
Source File: Lang_51_BooleanUtils_t.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 16
Source File: Nopol2015_003_t.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 17
Source File: BooleanUtils.java From lams with GNU General Public License v2.0 | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 18
Source File: Arja_0072_s.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 19
Source File: Arja_0020_t.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }
Example 20
Source File: Elixir_0014_t.java From coming with MIT License | 2 votes |
/** * <p>Converts a boolean to an Integer using the convention that * <code>zero</code> is <code>false</code>.</p> * * <pre> * BooleanUtils.toIntegerObject(true) = new Integer(1) * BooleanUtils.toIntegerObject(false) = new Integer(0) * </pre> * * @param bool the boolean to convert * @return one if <code>true</code>, zero if <code>false</code> */ public static Integer toIntegerObject(boolean bool) { return bool ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO; }