Class ArrayUtils


  • public class ArrayUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T[] concatAll​(T[] first, T[]... rest)
      Concatenates arrays
      static <T> T[] copyOf​(T[] source, int newlength)
      Makes a copy of an array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • copyOf

        public static <T> T[] copyOf​(T[] source,
                                     int newlength)
        Makes a copy of an array. If newLength is greater than the length of source, then the result is an array with the contents of source, appended with null elements. If the new array is shorter, then only a part is copied.
        Type Parameters:
        T - type of the array
        Parameters:
        source - source array
        newlength - new length of the target array
        Returns:
      • concatAll

        public static <T> T[] concatAll​(T[] first,
                                        T[]... rest)
        Concatenates arrays
        Type Parameters:
        T - type of the array
        Parameters:
        first - first array
        rest - arrays to be added
        Returns: