添加工具类 Arrays2。

feature/net-util
ZhouXY108 2023-03-10 18:04:59 +08:00
parent 2c4c9069c6
commit f480c27894
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
package xyz.zhouxy.plusone.commons.util;
public abstract class Arrays2 {
@SafeVarargs
public static <T> T[] of(final T... values) {
return values;
}
public static short[] of(final short... values) {
return values;
}
public static int[] of(final int... values) {
return values;
}
public static long[] of(final long... values) {
return values;
}
public static byte[] of(final byte... values) {
return values;
}
public static boolean[] of(final boolean... values) {
return values;
}
public static char[] of(final char... values) {
return values;
}
private Arrays2() {
throw new IllegalStateException("Utility class");
}
}