mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-07-27 12:36:03 +07:00
16 lines
459 B
Java
16 lines
459 B
Java
import java.lang.reflect.Method;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
|
|
class X {
|
|
public void foo(Class<?> cls)
|
|
{
|
|
Stream.of(cls.getMethods())
|
|
.filter(method ->
|
|
Collection.class.isAssignableFrom(<selection>method.getReturnType()</selection>) || Map.class.isAssignableFrom(method.getReturnType()))
|
|
.collect(Collectors.<Method>toList());
|
|
}
|
|
}
|