Java List Null Empty nullToEmpty(List nullable)

Here you can find the source of nullToEmpty(List nullable)

Description

null To Empty

License

Open Source License

Declaration

public static <T> List<T> nullToEmpty(List<T> nullable) 

Method Source Code

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

import java.util.Collections;

import java.util.List;

public class Main {
    public static <T> List<T> nullToEmpty(List<T> nullable) {
        return nullable == null ? Collections.<T>emptyList() : nullable;
    }/*from  ww w .  j av a  2  s.co  m*/
}

Related

  1. nullSafeAdd(List list, T elem)
  2. nullsafeAsList(T... elements)
  3. nullSafeList(List list)
  4. nullToEmpty(List in)
  5. nullToEmpty(List list)