Java List Remove Null Value removeNulls(Collection list)

Here you can find the source of removeNulls(Collection list)

Description

remove Nulls

License

Open Source License

Declaration

static public <T> void removeNulls(Collection<T> list) 

Method Source Code


//package com.java2s;

import java.util.Collection;
import java.util.Iterator;

public class Main {
    static public <T> void removeNulls(Collection<T> list) {
        for (Iterator<T> iter = list.iterator(); iter.hasNext();) {
            T e = iter.next();/*ww  w  .j  a  v  a  2  s  .  c o m*/
            if (e == null)
                iter.remove();
        }
    }
}

Related

  1. removeNullableItems(List exceptIds)
  2. removeNullAndDuplicates(List list)
  3. removeNullElement(List source)
  4. removeNullElements(List list)
  5. removeNullFromList(List list)
  6. removeNulls(final List list)
  7. removeNulls(List values)
  8. removeNulls(List list)
  9. removeNulls(List values)