Class ArrayUtils

java.lang.Object
org.yaml.snakeyaml.util.ArrayUtils

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

    Modifier and Type Method Description
    static <E> java.util.List<E> toUnmodifiableCompositeList​(E[] array1, E[] array2)
    Returns an unmodifiable List containing the second array appended to the first one.
    static <E> java.util.List<E> toUnmodifiableList​(E[] elements)
    Returns an unmodifiable List backed by the given array.

    Methods inherited from class java.lang.Object

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

    • toUnmodifiableList

      public static <E> java.util.List<E> toUnmodifiableList​(E[] elements)
      Returns an unmodifiable List backed by the given array. The method doesn't copy the array, so the changes to the array will affect the List as well.
      Type Parameters:
      E - class of the elements in the array
      Parameters:
      elements - - array to convert
      Returns:
      List backed by the given array
    • toUnmodifiableCompositeList

      public static <E> java.util.List<E> toUnmodifiableCompositeList​(E[] array1, E[] array2)
      Returns an unmodifiable List containing the second array appended to the first one. The method doesn't copy the arrays, so the changes to the arrays will affect the List as well.
      Type Parameters:
      E - class of the elements in the array
      Parameters:
      array1 - - the array to extend
      array2 - - the array to add to the first
      Returns:
      List backed by the given arrays