Java List Cast IS_CASTABLE_LIST(Class className, Object obj)

Here you can find the source of IS_CASTABLE_LIST(Class className, Object obj)

Description

ICASTABLLIST

License

Open Source License

Declaration

public static boolean IS_CASTABLE_LIST(Class<?> className, Object obj) 

Method Source Code

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

import java.util.List;

public class Main {
    public static boolean IS_CASTABLE_LIST(Class<?> className, Object obj) {
        if (!(obj instanceof List))
            return false;

        for (Object o : (List<?>) obj)
            if (!className.isInstance(o))
                return false;

        return true;
    }/* w  ww  .  j ava  2s  . c o  m*/
}

Related

  1. castOrCopyToList(Iterable iterable)
  2. castTo(final List list, final Class clasz)
  3. castToDocumentList(Object obj)
  4. castToList(U[] array, Class clazz)
  5. castToStringList(Object value)
  6. listToJsonArray(List ll, Class toCast, String jsonArrayKey)
  7. toStringList(List uncastedValues)

    HOME | Copyright © www.java2s.com 2016