Modifier and Type | Class and Description |
---|---|
static interface |
Action1.Function<T>
A functional interface for the containing delegate type.
|
Constructor and Description |
---|
Action1()
Creates a new instance of this delegate.
|
Action1(Class<?> targetClass,
String methodName,
Class<?>... methodParameterClasses)
Initializes a delegate that will invoke a static method on a class.
|
Action1(Object targetObject,
String methodName,
Class<?>... methodParameterClasses)
Initializes a delegate that will invoke an instance method on a class instance.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T t)
Performs this operation on the given argument.
|
abstract void |
invoke(T obj)
Represents a method that takes a single parameter and does not return a value.
|
static <T> Action1<T> |
of(Action1.Function<T> f)
Create a delegate for the given interface.
|
static <T> Action1<T> |
of(Action1.Function<T> f,
Class<?> targetClass,
String methodName,
Class<?>... methodParameterClasses)
Create a delegate for the given interface.
|
static <T> Action1<T> |
of(Action1.Function<T> f,
Object targetObject,
String methodName,
Class<?>... methodParameterClasses)
Create a delegate for the given interface.
|
dynamicInvoke, equals, getMethod, getTarget, hashCode
public Action1()
public Action1(@Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses)
targetObject
- The class instance on which the delegate will invoke the method.methodName
- The name of the instance method.methodParameterClasses
- The type of the parameters of the instance method.public Action1(@Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses)
targetClass
- The class that defines the method.methodName
- The name of the static method.methodParameterClasses
- The type of the parameters of the static method.public abstract void invoke(T obj)
obj
- The parameter to the method.public final void accept(T t)
java.util.function.Consumer
@Nonnull public static <T> Action1<T> of(@Nonnull Action1.Function<T> f)
f
- The function which will be invoked.@Nonnull public static <T> Action1<T> of(@Nonnull Action1.Function<T> f, @Nonnull Object targetObject, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses)
f
- The function which will be invoked.targetObject
- The class instance on which the delegate will invoke the method.methodName
- The name of the instance method.methodParameterClasses
- The type of the parameters of the instance method.@Nonnull public static <T> Action1<T> of(@Nonnull Action1.Function<T> f, @Nonnull Class<?> targetClass, @Nonnull String methodName, @Nonnull Class<?>... methodParameterClasses)
f
- The function which will be invoked.targetClass
- The class that defines the method.methodName
- The name of the static method.methodParameterClasses
- The type of the parameters of the static method.