Class KiwiPrimitives


  • public class KiwiPrimitives
    extends Object
    Static utilities that operate on primitive values, and are not already provided by classes in Guava's com.google.common.primitives package.
    • Constructor Detail

      • KiwiPrimitives

        public KiwiPrimitives()
    • Method Detail

      • firstNonZero

        public static int firstNonZero​(int first,
                                       int second)
        Returns the first non-zero argument, otherwise throws IllegalArgumentException if both arguments are zero.
        Parameters:
        first - the first int to check
        second - the second int to check
        Returns:
        the first non-zero value
        Throws:
        IllegalArgumentException - if both arguments are zero
      • firstNonZero

        public static long firstNonZero​(long first,
                                        long second)
        Returns the first non-zero argument, otherwise throws IllegalArgumentException if both arguments are zero.
        Parameters:
        first - the first int to check
        second - the second int to check
        Returns:
        the first non-zero value
        Throws:
        IllegalArgumentException - if both arguments are zero