Class 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 Detail

      • ArrayUtil

        private ArrayUtil()
    • Method Detail

      • asList

        public static List<Integer> asList​(int[] vals)
      • asList

        public static List<Short> asList​(short[] vals)
      • asList

        public static List<Long> asList​(long[] vals)
      • asList

        public static List<Byte> asList​(byte[] vals)
      • asList

        public static List<Float> asList​(float[] vals)
      • asList

        public static List<Double> asList​(double[] vals)
      • 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.