Here you can find the source of isCollectionOrArray(Class> type)
Parameter | Description |
---|---|
type | a parameter |
public static boolean isCollectionOrArray(Class<?> type)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { /**/* www .ja v a 2 s.c o m*/ * @param type * @return true if it's a collection or an array type. */ public static boolean isCollectionOrArray(Class<?> type) { return isCollection(type) || type.isArray(); } /** * @param type * @return true if the type can be assigned to a {@link Collection} class */ public static boolean isCollection(Class<?> type) { return Collection.class.isAssignableFrom(type); } }