All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nls.util.ArrayUtil Maven / Gradle / Ivy

The newest version!
package com.nls.util;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.function.IntFunction;

public final class ArrayUtil {
    private ArrayUtil() {

    }

    public static  T[] create(int length, Class type, IntFunction generator) {
        T[] a = (T[]) Array.newInstance(type, length);
        Arrays.parallelSetAll(a, generator);
        return a;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy