public class MethodStream extends java.lang.Object implements java.util.stream.Stream<MirrorMethod>
MirrorMethod
s that provides helper operationsConstructor and Description |
---|
MethodStream(java.util.stream.Stream<MirrorMethod> underlying)
Creates a new method stream based on the given underlying stream
|
Modifier and Type | Method and Description |
---|---|
boolean |
allMatch(java.util.function.Predicate<? super MirrorMethod> predicate) |
boolean |
anyMatch(java.util.function.Predicate<? super MirrorMethod> predicate) |
void |
close() |
<R,A> R |
collect(java.util.stream.Collector<? super MirrorMethod,A,R> collector) |
<R> R |
collect(java.util.function.Supplier<R> supplier,
java.util.function.BiConsumer<R,? super MirrorMethod> accumulator,
java.util.function.BiConsumer<R,R> combiner) |
long |
count() |
MethodStream |
distinct() |
MethodStream |
filter(java.util.function.Predicate<? super MirrorMethod> predicate) |
MethodStream |
filterDeclaringClass(java.lang.Class<?>... classes)
Filters this stream by if the method is declared in one of the given classes
|
java.util.Optional<MirrorMethod> |
findAny() |
java.util.Optional<MirrorMethod> |
findFirst() |
<R> java.util.stream.Stream<R> |
flatMap(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.Stream<? extends R>> mapper) |
java.util.stream.DoubleStream |
flatMapToDouble(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.DoubleStream> mapper) |
java.util.stream.IntStream |
flatMapToInt(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.IntStream> mapper) |
java.util.stream.LongStream |
flatMapToLong(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.LongStream> mapper) |
void |
forEach(java.util.function.Consumer<? super MirrorMethod> action) |
void |
forEachOrdered(java.util.function.Consumer<? super MirrorMethod> action) |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> clazz)
Maps this stream of methods given annotations on the methods
|
MethodStream |
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Filters this stream by if the method has the given annotation
|
MethodStream |
hasModifier(int modifier)
Filters this stream by if the method has the given modifier
|
java.util.stream.Stream<java.lang.Object> |
invoke(java.lang.Object instance,
java.lang.Object... args)
Maps this stream of methods to the results of their invocations on the given instance with the given arguments
|
java.lang.Object[] |
invokeToArray(java.lang.Object instance,
java.lang.Object... args)
Maps this stream of methods to the results of their invocations on the given instance with the given arguments
and converts them to an array
|
MethodStream |
isAbstract()
Filters this stream by if the method is abstract
|
MethodStream |
isNotAbstract()
Filters this stream by if the method is not abstract
|
MethodStream |
isNotStatic()
Filters this stream by if the method is not static
|
boolean |
isParallel() |
MethodStream |
isPrivate()
Filters this stream by if the method is private
|
MethodStream |
isProtected()
Filters this stream by if the method is protected
|
MethodStream |
isPublic()
Filters this stream by if the method is public
|
MethodStream |
isStatic()
Filters this stream by if the method is static
|
java.util.Iterator<MirrorMethod> |
iterator() |
MethodStream |
limit(long maxSize) |
<R> java.util.stream.Stream<R> |
map(java.util.function.Function<? super MirrorMethod,? extends R> mapper) |
java.util.stream.DoubleStream |
mapToDouble(java.util.function.ToDoubleFunction<? super MirrorMethod> mapper) |
java.util.stream.IntStream |
mapToInt(java.util.function.ToIntFunction<? super MirrorMethod> mapper) |
java.util.stream.LongStream |
mapToLong(java.util.function.ToLongFunction<? super MirrorMethod> mapper) |
java.util.Optional<MirrorMethod> |
max(java.util.Comparator<? super MirrorMethod> comparator) |
java.util.Optional<MirrorMethod> |
min(java.util.Comparator<? super MirrorMethod> comparator) |
boolean |
noneMatch(java.util.function.Predicate<? super MirrorMethod> predicate) |
java.util.stream.Stream<MirrorMethod> |
onClose(java.lang.Runnable closeHandler) |
MethodStream |
parallel() |
MethodStream |
peek(java.util.function.Consumer<? super MirrorMethod> action) |
java.util.Optional<MirrorMethod> |
reduce(java.util.function.BinaryOperator<MirrorMethod> accumulator) |
MirrorMethod |
reduce(MirrorMethod identity,
java.util.function.BinaryOperator<MirrorMethod> accumulator) |
<U> U |
reduce(U identity,
java.util.function.BiFunction<U,? super MirrorMethod,U> accumulator,
java.util.function.BinaryOperator<U> combiner) |
MethodStream |
sequential() |
MethodStream |
setAccessible(boolean accessible)
Sets each method in this stream to be accessible
|
MethodStream |
skip(long n) |
MethodStream |
sorted() |
MethodStream |
sorted(java.util.Comparator<? super MirrorMethod> comparator) |
java.util.Spliterator<MirrorMethod> |
spliterator() |
java.lang.Object[] |
toArray() |
<A> A[] |
toArray(java.util.function.IntFunction<A[]> generator) |
MethodStream |
unordered() |
java.util.stream.Stream<java.lang.reflect.Method> |
unwrap()
Maps this stream of
MirrorMethod s to a stream of unwrapped Method s |
public MethodStream(java.util.stream.Stream<MirrorMethod> underlying)
underlying
- The underlying stream to use for all stream operationspublic java.util.stream.Stream<java.lang.reflect.Method> unwrap()
MirrorMethod
s to a stream of unwrapped Method
spublic MethodStream filterDeclaringClass(java.lang.Class<?>... classes)
classes
- The classes to filter bypublic java.util.stream.Stream<java.lang.Object> invoke(java.lang.Object instance, java.lang.Object... args)
instance
- The instance to invoke the methods onargs
- The arguments to pass to the methodpublic java.lang.Object[] invokeToArray(java.lang.Object instance, java.lang.Object... args)
instance
- The instance to invoke the methods onargs
- The arguments to pass to the methodpublic MethodStream hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
clazz
- The annotation classpublic <A extends java.lang.annotation.Annotation> java.util.stream.Stream<A> getAnnotation(java.lang.Class<A> clazz)
A
- The annotation typeclazz
- The annotation classpublic MethodStream isStatic()
public MethodStream isNotStatic()
public MethodStream isAbstract()
public MethodStream isNotAbstract()
public MethodStream isPublic()
public MethodStream isProtected()
public MethodStream isPrivate()
public MethodStream hasModifier(int modifier)
modifier
- The modifier to filter bypublic MethodStream setAccessible(boolean accessible)
accessible
- If the method is accessiblepublic MethodStream filter(java.util.function.Predicate<? super MirrorMethod> predicate)
filter
in interface java.util.stream.Stream<MirrorMethod>
public <R> java.util.stream.Stream<R> map(java.util.function.Function<? super MirrorMethod,? extends R> mapper)
map
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.IntStream mapToInt(java.util.function.ToIntFunction<? super MirrorMethod> mapper)
mapToInt
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.LongStream mapToLong(java.util.function.ToLongFunction<? super MirrorMethod> mapper)
mapToLong
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.DoubleStream mapToDouble(java.util.function.ToDoubleFunction<? super MirrorMethod> mapper)
mapToDouble
in interface java.util.stream.Stream<MirrorMethod>
public <R> java.util.stream.Stream<R> flatMap(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.Stream<? extends R>> mapper)
flatMap
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.IntStream flatMapToInt(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.IntStream> mapper)
flatMapToInt
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.LongStream flatMapToLong(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.LongStream> mapper)
flatMapToLong
in interface java.util.stream.Stream<MirrorMethod>
public java.util.stream.DoubleStream flatMapToDouble(java.util.function.Function<? super MirrorMethod,? extends java.util.stream.DoubleStream> mapper)
flatMapToDouble
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream distinct()
distinct
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream sorted()
sorted
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream sorted(java.util.Comparator<? super MirrorMethod> comparator)
sorted
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream peek(java.util.function.Consumer<? super MirrorMethod> action)
peek
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream limit(long maxSize)
limit
in interface java.util.stream.Stream<MirrorMethod>
public MethodStream skip(long n)
skip
in interface java.util.stream.Stream<MirrorMethod>
public void forEach(java.util.function.Consumer<? super MirrorMethod> action)
forEach
in interface java.util.stream.Stream<MirrorMethod>
public void forEachOrdered(java.util.function.Consumer<? super MirrorMethod> action)
forEachOrdered
in interface java.util.stream.Stream<MirrorMethod>
public java.lang.Object[] toArray()
toArray
in interface java.util.stream.Stream<MirrorMethod>
public <A> A[] toArray(java.util.function.IntFunction<A[]> generator)
toArray
in interface java.util.stream.Stream<MirrorMethod>
public MirrorMethod reduce(MirrorMethod identity, java.util.function.BinaryOperator<MirrorMethod> accumulator)
reduce
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Optional<MirrorMethod> reduce(java.util.function.BinaryOperator<MirrorMethod> accumulator)
reduce
in interface java.util.stream.Stream<MirrorMethod>
public <U> U reduce(U identity, java.util.function.BiFunction<U,? super MirrorMethod,U> accumulator, java.util.function.BinaryOperator<U> combiner)
reduce
in interface java.util.stream.Stream<MirrorMethod>
public <R> R collect(java.util.function.Supplier<R> supplier, java.util.function.BiConsumer<R,? super MirrorMethod> accumulator, java.util.function.BiConsumer<R,R> combiner)
collect
in interface java.util.stream.Stream<MirrorMethod>
public <R,A> R collect(java.util.stream.Collector<? super MirrorMethod,A,R> collector)
collect
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Optional<MirrorMethod> min(java.util.Comparator<? super MirrorMethod> comparator)
min
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Optional<MirrorMethod> max(java.util.Comparator<? super MirrorMethod> comparator)
max
in interface java.util.stream.Stream<MirrorMethod>
public long count()
count
in interface java.util.stream.Stream<MirrorMethod>
public boolean anyMatch(java.util.function.Predicate<? super MirrorMethod> predicate)
anyMatch
in interface java.util.stream.Stream<MirrorMethod>
public boolean allMatch(java.util.function.Predicate<? super MirrorMethod> predicate)
allMatch
in interface java.util.stream.Stream<MirrorMethod>
public boolean noneMatch(java.util.function.Predicate<? super MirrorMethod> predicate)
noneMatch
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Optional<MirrorMethod> findFirst()
findFirst
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Optional<MirrorMethod> findAny()
findAny
in interface java.util.stream.Stream<MirrorMethod>
public java.util.Iterator<MirrorMethod> iterator()
iterator
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public java.util.Spliterator<MirrorMethod> spliterator()
spliterator
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public boolean isParallel()
isParallel
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public MethodStream sequential()
sequential
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public MethodStream parallel()
parallel
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public MethodStream unordered()
unordered
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public java.util.stream.Stream<MirrorMethod> onClose(java.lang.Runnable closeHandler)
onClose
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>
public void close()
close
in interface java.lang.AutoCloseable
close
in interface java.util.stream.BaseStream<MirrorMethod,java.util.stream.Stream<MirrorMethod>>