Java List Cast cast(List list)

Here you can find the source of cast(List list)

Description

cast

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> List<T> cast(List<?> list) 

Method Source Code

//package com.java2s;

import java.util.List;
import java.util.Map;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> List<T> cast(List<?> list) {
        return (List<T>) list;
    }//from   w  ww.ja  va  2  s  . c  o m

    @SuppressWarnings("unchecked")
    public static <K, V> Map<K, V> cast(Map<?, ?> map) {
        return (Map<K, V>) map;
    }
}

Related

  1. cast(final Class cls, final Object[] list)
  2. cast(final Collection list)
  3. cast(final List list)
  4. cast(List list)
  5. cast(List list)
  6. cast(List list, Class klass)
  7. cast(List from)
  8. CAST_LIST(Class className, Object obj)
  9. castList(Class clazz, Collection c)