Here you can find the source of isAJavaPrimitiveArrayClass(final Class> type)
Parameter | Description |
---|---|
type | a parameter |
public static boolean isAJavaPrimitiveArrayClass(final Class<?> type)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**/*from ww w. j a v a2 s . c o m*/ * * @param type * @return true if class is a primitive array class. Otherwise it returns false. */ public static boolean isAJavaPrimitiveArrayClass(final Class<?> type) { return getAllJavaPrimitiveArrayClasses().contains(type); } public static List<Class<?>> getAllJavaPrimitiveArrayClasses() { List<Class<?>> listAllClasses = getNumbersJavaPrimitiveArrayClasses(); listAllClasses.addAll(getOtherJavaPrimitiveArrayClasses()); return listAllClasses; } public static List<Class<?>> getNumbersJavaPrimitiveArrayClasses() { List<Class<?>> listClasses = new ArrayList<Class<?>>(); listClasses.add(int[].class); listClasses.add(Integer[].class); listClasses.add(long[].class); listClasses.add(Long[].class); listClasses.add(double[].class); listClasses.add(Double[].class); listClasses.add(short[].class); listClasses.add(Short[].class); listClasses.add(float[].class); listClasses.add(Float[].class); return listClasses; } public static List<Class<?>> getOtherJavaPrimitiveArrayClasses() { List<Class<?>> listClasses = new ArrayList<Class<?>>(); listClasses.add(char[].class); listClasses.add(Character[].class); listClasses.add(boolean[].class); listClasses.add(Boolean[].class); listClasses.add(String[].class); return listClasses; } }