Java List Null Empty getEmptyList(Class cls)

Here you can find the source of getEmptyList(Class cls)

Description

get Empty List

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> List<T> getEmptyList(Class<T> cls) 

Method Source Code

//package com.java2s;

import java.util.Collections;

import java.util.List;

public class Main {
    public static final List<?> emptyList = Collections.EMPTY_LIST;

    @SuppressWarnings("unchecked")
    public static <T> List<T> getEmptyList() {
        return (List<T>) emptyList;
    }/*from ww w  .jav a2s  .c o  m*/

    @SuppressWarnings("unchecked")
    public static <T> List<T> getEmptyList(Class<T> cls) {
        return (List<T>) emptyList;
    }
}

Related

  1. equalsNullSafe(List list1, List list2)
  2. fillEmptyEntries(Iterable keys, Map> map)
  3. fillNull(final List list, final int numElements)
  4. fillNull(List lst, int size)
  5. fillUpWithNulls(List list)
  6. getEmptyList(Class tClass)
  7. getIgnoreNull(List list, int n)
  8. getListIgnoringNulls(T[] items)
  9. getNonNull(List list)