Java Collection Check isClassCollection(Class c)

Here you can find the source of isClassCollection(Class c)

Description

is Class Collection

License

Open Source License

Declaration

private static int isClassCollection(Class<?> c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

import java.util.Map;

public class Main {
    private static int isClassCollection(Class<?> c) {

        if (Collection.class.isAssignableFrom(c)) {
            return 1;
        } else if (Map.class.isAssignableFrom(c)) {
            return 2;
        } else {/*  ww  w.  ja  v a  2s.co  m*/
            return 0;
        }
    }
}

Related

  1. isBlank(Collection collection)
  2. isBlank(final Collection c)
  3. isBlank(final Collection collection)
  4. isBlankAll(Collection... collections)
  5. isC2InC1(Collection c1, Collection c2)
  6. isClassCollection(Class c)
  7. isClassCollection(Class type)
  8. isCollection(Class c)
  9. isCollection(Class clazz)