public class MethodStream
extends java.lang.Object
| Constructor and Description |
|---|
MethodStream(RStream parent,
boolean withSuper) |
| Modifier and Type | Method and Description |
|---|---|
MethodWrapper |
by(java.lang.Class<?>... parameterTypes)
Get a method by the given parameter types.
|
MethodWrapper |
by(int index)
Get a method by the given index.
|
MethodWrapper |
by(java.lang.String name)
Get a method by the given name.
|
MethodWrapper |
by(java.lang.String name,
java.lang.Class<?>... parameterTypes)
Get a method by the given name and parameter types.
|
MethodStream |
copy() |
MethodStream |
filter(boolean isStatic)
Filter the methods by whether they are static.
|
MethodStream |
filter(java.lang.Class<?>... parameterTypes)
Filter the methods by the given parameter types.
|
MethodStream |
filter(java.util.Collection<java.lang.String> names)
Filter the methods by the given names.
|
MethodStream |
filter(java.util.function.Predicate<MethodWrapper> filter)
Filter the methods with the given filter.
|
MethodStream |
filter(java.lang.String... names)
Filter the methods by the given names.
|
MethodStream |
filter(java.lang.String name)
Filter the methods by the given name.
|
MethodStream |
filterAnnotation(java.lang.Class<?> annotation)
Filter the methods by whether they have the given annotation.
|
MethodStream |
forEach(java.util.function.Consumer<MethodWrapper> consumer)
Loop through all methods in this stream.
|
java.util.Iterator<MethodWrapper> |
iterator() |
java.util.stream.Stream<MethodWrapper> |
jstream() |
<T> java.util.stream.Stream<T> |
map(java.util.function.Function<MethodWrapper,T> mapFunction)
Map the methods to a new stream.
|
java.util.Optional<MethodWrapper> |
opt(java.lang.Class<?>... parameterTypes)
Get a method by the given parameter types.
|
java.util.Optional<MethodWrapper> |
opt(int index)
Get a method by the given index.
|
java.util.Optional<MethodWrapper> |
opt(java.lang.String name)
Get a method by the given name.
|
java.util.Optional<MethodWrapper> |
opt(java.lang.String name,
java.lang.Class<?>... parameterTypes)
Get a method by the given name and parameter types.
|
RStream |
parent() |
int |
size() |
public MethodStream(RStream parent, boolean withSuper)
public RStream parent()
public int size()
public java.util.Optional<MethodWrapper> opt(java.lang.String name)
name - The name of the methodpublic java.util.Optional<MethodWrapper> opt(@Nullable java.lang.Class<?>... parameterTypes)
parameterTypes - The parameter types of the methodpublic java.util.Optional<MethodWrapper> opt(java.lang.String name, @Nullable java.lang.Class<?>... parameterTypes)
name - The name of the methodparameterTypes - The parameter types of the methodpublic java.util.Optional<MethodWrapper> opt(int index)
index - The index of the methodpublic MethodWrapper by(java.lang.String name)
name - The name of the methodMethodNotFoundException - If the method doesn't existpublic MethodWrapper by(@Nullable java.lang.Class<?>... parameterTypes)
parameterTypes - The parameter types of the methodMethodNotFoundException - If the method doesn't existpublic MethodWrapper by(java.lang.String name, @Nullable java.lang.Class<?>... parameterTypes)
name - The name of the methodparameterTypes - The parameter types of the methodMethodNotFoundException - If the method doesn't existpublic MethodWrapper by(int index)
index - The index of the methodMethodNotFoundException - If the method doesn't existpublic MethodStream filter(java.util.function.Predicate<MethodWrapper> filter)
filter - The filterpublic MethodStream filter(java.lang.String name)
name - The name of the methodpublic MethodStream filter(java.util.Collection<java.lang.String> names)
names - The names of the methodspublic MethodStream filter(java.lang.String... names)
names - The names of the methodspublic MethodStream filter(@Nullable java.lang.Class<?>... parameterTypes)
parameterTypes - The parameter types of the methodpublic MethodStream filter(boolean isStatic)
isStatic - Whether the methods should be staticpublic MethodStream filterAnnotation(java.lang.Class<?> annotation)
annotation - The annotationpublic java.util.Iterator<MethodWrapper> iterator()
public <T> java.util.stream.Stream<T> map(java.util.function.Function<MethodWrapper,T> mapFunction)
jstream() and then Stream.map(Function).T - The type of the new streammapFunction - The map functionpublic java.util.stream.Stream<MethodWrapper> jstream()
public MethodStream forEach(java.util.function.Consumer<MethodWrapper> consumer)
consumer - The consumerpublic MethodStream copy()