下面列出了org.apache.commons.lang.math.NumberUtils#INTEGER_ZERO 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}
/**
* <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;
}