Package org.apache.johnzon.core.util
Class ArrayUtil
- java.lang.Object
-
- org.apache.johnzon.core.util.ArrayUtil
-
public final class ArrayUtil extends Object
Various Array utils which do not exist in Java or are performing badly. NOTE: we keep this here and in Mapper duplicated to not have Mapper depending on johnzon-core!
-
-
Constructor Summary
Constructors Modifier Constructor Description privateArrayUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Byte>asList(byte[] vals)static List<Character>asList(char[] vals)static List<Double>asList(double[] vals)static List<Float>asList(float[] vals)static List<Integer>asList(int[] vals)static List<Long>asList(long[] vals)static List<Short>asList(short[] vals)static List<Object>asList(Object[] vals)static Collection<Object>newCollection(Object array)Take the given array object and fill a fresh Collection with it.
-
-
-
Method Detail
-
newCollection
public static Collection<Object> newCollection(Object array)
Take the given array object and fill a fresh Collection with it.- Parameters:
array- an array that is to be duplicated- Returns:
- a new collection of the original array elements
- Throws:
IllegalArgumentException- if the given value this is not an array.
-
-