Skip to content
Snippets Groups Projects
Commit 82fda4f2 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

adds collectToEList

refs 2490
parent 8e8911f4
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.NotificationImpl;
......@@ -548,4 +550,12 @@ public class EcoreUtils {
}
return true;
}
/**
* @param s
* @return an {@link EList} containing the elements of <code>s</code>.
*/
public static <T> EList<T> collectToEList(Stream<T> s) {
return new BasicEList<T>(s.collect(Collectors.toList()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment