Class ArrayUtil

java.lang.Object
org.drasyl.util.ArrayUtil

public final class ArrayUtil extends Object
Utility class for operations on arrays.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <E> E[]
    Returns an empty arrray.
    static byte[]
    concat(byte[]... arrays)
    Returns a new array containing all elements from given arrays.
    static <E> E[]
    concat(E[]... arrays)
    Returns a new array containing all elements from given arrays.

    Methods inherited from class java.lang.Object

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

    • concat

      public static <E> E[] concat()
      Returns an empty arrray. This noop method is required to prevent ambiguous calls.
      Type Parameters:
      E - array element type
      Returns:
      empty array
    • concat

      public static <E> E[] concat(E[]... arrays)
      Returns a new array containing all elements from given arrays.
      Type Parameters:
      E - array element type
      Parameters:
      arrays - arrays to concatenate
      Returns:
      array containing all elements from given arrays
    • concat

      public static byte[] concat(byte[]... arrays)
      Returns a new array containing all elements from given arrays.
      Type Parameters:
      E - array element type
      Parameters:
      arrays - arrays to concatenate
      Returns:
      array containing all elements from given arrays