Java Stream Operation filterInstances(Stream stream, Class clazz)

Here you can find the source of filterInstances(Stream stream, Class clazz)

Description

filter Instances

License

Apache License

Declaration

public static <T, U> Stream<T> filterInstances(Stream<T> stream, Class<U> clazz) 

Method Source Code

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

    import java.util.stream.Stream;

    public class Main {
        public static <T, U> Stream<T> filterInstances(Stream<T> stream, Class<U> clazz) {
    return stream.filter(clazz::isInstance);
}
    }/*  www.  j  av a  2s .  c o  m*/

Related

  1. createStream(final Iterator iterator)
  2. endsWith(Stream stream, Iterable iterable)
  3. enumerationAsStream(Enumeration e)
  4. equals(Stream first, Stream second)
  5. factorStream(long number)
  6. filterType(Stream stream, Class type)
  7. findLast(Stream s)
  8. findLastOf(Stream stream)
  9. findStreamAmongst(Class clazz, Collection instances)