public final class InternalArrays extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
EMPTY_BYTES |
static String[] |
EMPTY_STRINGS |
| Modifier and Type | Method and Description |
|---|---|
static <E> List<E> |
asImmutableList(E... a)
Wrap an array to an immutable
List without deep copy. |
static <E> Iterator<E> |
asIterator(E... a)
Wrap an array to a read only
Iterator. |
static <E> List<E> |
toImmutableList(E... a)
Convert an array to an immutable
List with array copy. |
public static final byte[] EMPTY_BYTES
public static final String[] EMPTY_STRINGS
@SafeVarargs public static <E> List<E> asImmutableList(E... a)
List without deep copy.
WARNING: make sure a will not be changed by other one.
E - the type for elements of a.a - the array which want to be wrapped.List.@SafeVarargs public static <E> List<E> toImmutableList(E... a)
List with array copy. It will copy array but will not clone
each element.E - the type for elements of a.a - the array which want to be converted.List.@SafeVarargs public static <E> Iterator<E> asIterator(E... a)
Iterator.
WARNING: make sure a will not be changed by other one.
E - the type for elements of a.a - the array which want to be wrapped.Iterator.Copyright © 2018–2023 asyncer.io. All rights reserved.