Lists

public final class Lists extends Object

Helper function for list operations.

Methods

unmodifiableCopyOf

public static <E>List<E> unmodifiableCopyOf(E[] array)

Returns an unmodifiable copy of the array.

Parameters

Name Description
E[] array

the array for which an unmodifiable Listis to be returned.

ReturnValue

Name Description
List<E>

an unmodifiable Listof the specified array.

unmodifiableCopyOf

public static <E>List<E> unmodifiableCopyOf(List<E> list)

Returns an unmodifiable copy of the list.

Parameters

Name Description
List<E> list

the list for which an unmodifiable Listis to be returned.

ReturnValue

Name Description
List<E>

an unmodifiable Listof the specified list.

unmodifiableListOf

public static <E>List<E> unmodifiableListOf(E... elements)

Returns an unmodifiable list of elements.

Parameters

Name Description
E... elements

the array for which an unmodifiable Listis to be returned.

ReturnValue

Name Description
List<E>

an unmodifiable Listof the specified list.