Class ArrayUtil


  • public final class ArrayUtil
    extends Object
    • Field Detail

      • STRING_TYPE_ARRAY

        public static final String[] STRING_TYPE_ARRAY
      • INT_TYPE_ARRAY

        public static final int[] INT_TYPE_ARRAY
    • Method Detail

      • asList

        public static <T> List<T> asList​(T[] array)
      • asCollection

        public static <T> Collection<T> asCollection​(T[] array)
      • asIntArray

        public static int[] asIntArray​(int... ints)
      • asIntegerList

        public static List<Integer> asIntegerList​(int... ints)
      • isEmpty

        public static boolean isEmpty​(int[] array)
      • isEmpty

        public static boolean isEmpty​(String[] array)
      • isNotEmpty

        public static boolean isNotEmpty​(int[] array)
      • isNotEmpty

        public static boolean isNotEmpty​(String[] array)
      • asIntArray

        public static int[] asIntArray​(Collection<Integer> list)
        Transforms the given collection of Integers to an array of primitive int values.
        Parameters:
        list - The collection of Integers to transform
        Returns:
        The array representation of primitive int values.
      • subarray

        public static int[] subarray​(int[] array,
                                     int startIndexInclusive,
                                     int endIndexExclusive)
        Creates a new int array containing the elements between start and end indices.

        Similar to Apache Commons Lang ArrayUtils.subarray()

        Parameters:
        array -
        startIndexInclusive -
        endIndexExclusive -
        Returns: