Java List Null Empty newListIfNull(List list)

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

Description

new List If Null

License

Apache License

Declaration

public static <T> List<T> newListIfNull(List<T> list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.List;

public class Main {

    public static <T> List<T> newListIfNull(List<T> list) {
        if (list == null) {
            return new ArrayList<T>();
        } else {/* w ww . j av  a2 s  .c  o m*/
            return list;
        }
    }
}

Related

  1. isObjectListEmpty(List list)
  2. listToItemOrNull(List list)
  3. listWithoutNull(A... elements)
  4. listWithoutNull(final List list)
  5. maskNull(List pTypes)
  6. newListWhenNull(List list)
  7. newListWithOneNull()
  8. nullOrEmpty(List s)
  9. nullOrEmptyList(List list)