public final class Arrays extends Object
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
asList(T[] a)
Converts the specified array to a
List . |
static byte[] |
clean(byte[] bytes)
Returns the byte array unaltered if it is non-null and has a positive length, otherwise
null . |
static Object |
copy(Object obj)
Creates a shallow copy of the specified object or array.
|
static int |
length(byte[] bytes)
Returns the length of the specified byte array, or
0 if the byte array is null . |
static <T> int |
length(T[] a)
Returns the length of the array, or
0 if the array is null . |
public static <T> int length(T[] a)
0
if the array is null
.T
- the type of elements in the arraya
- the possibly-null arraypublic static <T> List<T> asList(T[] a)
List
. If the array is empty, an empty list will be returned.T
- the type of elements in the arraya
- the array to represent as a listpublic static int length(byte[] bytes)
0
if the byte array is null
.bytes
- the array to check0
if the byte array is null
.public static byte[] clean(byte[] bytes)
null
.bytes
- the byte array to check.null
.Copyright © 2014–2023 jsonwebtoken.io. All rights reserved.