Java Collection Check isCollection(final Object collection)

Here you can find the source of isCollection(final Object collection)

Description

Returns true if the collection is implements Collection; false otherwise.

License

Apache License

Parameter

Parameter Description
collection the collection to be tested.

Return

true if the collection is implements Collection; false otherwise.

Declaration

public static boolean isCollection(final Object collection) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

public class Main {
    /**//from  w ww .  j  a  v a  2 s . c  om
     * Returns true if the collection is implements Collection; false otherwise.
     * 
     * @param collection
     *            the collection to be tested.
     * @return true if the collection is implements Collection; false otherwise.
     */
    public static boolean isCollection(final Object collection) {

        return collection instanceof Collection;
    }
}

Related

  1. isCollection(Class clazz)
  2. isCollection(Class klass)
  3. isCollection(Class type)
  4. isCollection(Class clazz)
  5. isCollection(Class fieldClass)
  6. isCollection(final Object obj)
  7. isCollection(final Object value)
  8. isCollection(Object ob)
  9. isCollection(Object obj)