public class MethodWrapper
extends java.lang.Object
Method class for easy access to all required methods.| Constructor and Description |
|---|
MethodWrapper(MethodStream parent,
java.lang.reflect.Method method) |
| Modifier and Type | Method and Description |
|---|---|
java.util.stream.Stream<java.lang.annotation.Annotation> |
annotations() |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
<T> T |
invoke()
Invoke the method without any arguments.
|
<T> T |
invokeArgs(java.lang.Object... args)
Invoke the method with the given arguments.
|
<T> T |
invokeInstance(java.lang.Object instance,
java.lang.Object... args)
Invoke the method of the given instance with the given arguments.
|
ModifierWrapper |
modifier() |
java.lang.String |
name() |
java.lang.Class<?> |
owner() |
int |
parameterCount() |
java.lang.Class<?>[] |
parameterTypes() |
MethodStream |
parent() |
java.lang.reflect.Method |
raw() |
java.lang.Class<?> |
returnType() |
RStream |
stream()
Invoke the method without any arguments and wrap it in a new
RStream. |
RStream |
stream(java.lang.Class<?> clazz)
Invoke the method without any arguments and wrap it in a new
RStream. |
RStream |
streamArgs(java.lang.Class<?> clazz,
java.lang.Object... args)
Invoke the method with the given arguments and wrap it in a new
RStream. |
RStream |
streamArgs(java.lang.Object... args)
Invoke the method with the given arguments and wrap it in a new
RStream. |
RStream |
streamInstance(java.lang.Class<?> clazz,
java.lang.Object instance,
java.lang.Object... args)
Invoke the method of the given instance with the given arguments and wrap it in a new
RStream. |
RStream |
streamInstance(java.lang.Object instance,
java.lang.Object... args)
Invoke the method of the given instance with the given arguments and wrap it in a new
RStream. |
java.lang.String |
toString() |
public MethodWrapper(MethodStream parent, java.lang.reflect.Method method)
public MethodStream parent()
public java.lang.reflect.Method raw()
public java.lang.String name()
public java.lang.Class<?> returnType()
public java.lang.Class<?>[] parameterTypes()
public int parameterCount()
public java.lang.Class<?> owner()
public ModifierWrapper modifier()
ModifierWrapper of the methodpublic java.util.stream.Stream<java.lang.annotation.Annotation> annotations()
public <T> T invoke()
T - The type of the resultjava.lang.IllegalStateException - If the method is not static and no instance is cachedpublic RStream stream()
RStream.java.lang.IllegalStateException - If the method is not static and no instance is cachedpublic RStream stream(java.lang.Class<?> clazz)
RStream.clazz - The class used for the streamjava.lang.IllegalStateException - If the method is not static and no instance is cachedpublic <T> T invokeArgs(java.lang.Object... args)
T - The type of the resultargs - The arguments to pass to the methodjava.lang.IllegalStateException - If the method is not static and no instance is cachedpublic RStream streamArgs(java.lang.Object... args)
RStream.args - The arguments to pass to the methodjava.lang.IllegalStateException - If the method is not static and no instance is cachedpublic RStream streamArgs(java.lang.Class<?> clazz, java.lang.Object... args)
RStream.clazz - The class used for the streamargs - The arguments to pass to the methodjava.lang.IllegalStateException - If the method is not static and no instance is cachedpublic <T> T invokeInstance(java.lang.Object instance,
java.lang.Object... args)
T - The type of the resultinstance - The instance to invoke the method onargs - The arguments to pass to the methodpublic RStream streamInstance(java.lang.Object instance, java.lang.Object... args)
RStream.instance - The instance to invoke the method onargs - The arguments to pass to the methodpublic RStream streamInstance(java.lang.Class<?> clazz, java.lang.Object instance, java.lang.Object... args)
RStream.clazz - The class used for the streaminstance - The instance to invoke the method onargs - The arguments to pass to the methodpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object