Class KiwiIntegers

java.lang.Object
org.kiwiproject.base.KiwiIntegers

public final class KiwiIntegers extends Object
Utilities for working with Integer wrapper objects.
  • Method Details

    • toIntOrZero

      public static int toIntOrZero(@Nullable Integer integerObject)
      Return the int value of the Integer when non-null, otherwise return zero.
      Parameters:
      integerObject - the possibly null Integer object
      Returns:
      the int value of the Integer object when non-null, otherwise 0 (zero)
    • toIntOrDefault

      public static int toIntOrDefault(@Nullable Integer integerObject, int defaultValue)
      Return the int value of the Integer when non-null, otherwise return the default value.
      Parameters:
      integerObject - the possibly null Integer object
      defaultValue - the value to use when the Integer argument is null
      Returns:
      the int value of the Integer object when non-null, otherwise defaultValue