Java Utililty Methods List Cast

List of utility methods to do List Cast

Description

The list of methods to do List Cast are organized into topic(s).

Method

Listcast(Class clazz, List list)
cast
ArrayList<T> castedList = new ArrayList<T>();
for (Object o : list) {
    castedList.add((T) o);
return castedList;
Iterablecast(final Class cls, final Object[] list)
type safe cast from any array to an Iterable
return cast(cls, Arrays.asList(list));
Listcast(final Collection list)
cast
if (list instanceof List) {
    return (List<L>) list;
} else {
    return (List<L>) newList(list);
Listcast(final List list)
cast
return list;
Listcast(List list)
Helper method for cast any List to generic list.
return (List<T>) list;
Listcast(List list)
cast
return (List<T>) list;
Listcast(List list)
Casts a List to a List with a different element type.
return (List<T>) list;
Listcast(List list, Class klass)
Verifies that the passed list contains only elements of the given type, and returns it as a parameterized type.
for (Object obj : list) {
    klass.cast(obj);
return (List<T>) list;
Listcast(List from)
cast
return (List<E>) from;
ListCAST_LIST(Class className, Object obj)
CASLIST
return (List<T>) obj;