Java List Cast castList(final Object object)

Here you can find the source of castList(final Object object)

Description

Cast Object to List .

License

Open Source License

Parameter

Parameter Description
object Object

Declaration

@SuppressWarnings("unchecked")
public static <T> List<T> castList(final Object object) 

Method Source Code


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

import java.util.List;

public class Main {
    /**/*from   w  w  w.j  av  a  2 s .c o m*/
     * Cast {@link Object} to {@link List}.
     * 
     * @param object
     *            {@link Object}
     * @return {@link List}
     */
    @SuppressWarnings("unchecked")
    public static <T> List<T> castList(final Object object) {
        return (List<T>) object;
    }
}

Related

  1. castList(Class clazz, Collection collection)
  2. castList(Class elementType, List list)
  3. castList(Class klass, List list)
  4. castList(Collection c)
  5. castList(final List original)
  6. castList(List list, Class clazz)
  7. castListElem(List list, V target)
  8. castListUnchecked(Object list)
  9. castNonNullListParameterTo(String parameterName, List value, Class requiredType)