Package org.kiwiproject.base
Class KiwiIntegers
java.lang.Object
org.kiwiproject.base.KiwiIntegers
Utilities for working with
Integer wrapper objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic inttoIntOrDefault(@Nullable Integer integerObject, int defaultValue) Return theintvalue of theIntegerwhen non-null, otherwise return the default value.static inttoIntOrZero(@Nullable Integer integerObject) Return theintvalue of theIntegerwhen non-null, otherwise return zero.
-
Method Details
-
toIntOrZero
Return theintvalue of theIntegerwhen non-null, otherwise return zero.- Parameters:
integerObject- the possibly null Integer object- Returns:
- the
intvalue of the Integer object when non-null, otherwise0(zero)
-
toIntOrDefault
Return theintvalue of theIntegerwhen non-null, otherwise return the default value.- Parameters:
integerObject- the possibly null Integer objectdefaultValue- the value to use when the Integer argument is null- Returns:
- the
intvalue of the Integer object when non-null, otherwisedefaultValue
-