|
@@ -43,7 +43,7 @@ public final class EventFactory {
|
|
}
|
|
}
|
|
|
|
|
|
@Deprecated
|
|
@Deprecated
|
|
- @ApiStatus.ScheduledForRemoval
|
|
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
public static <T> Event<T> create(Function<T[], T> function) {
|
|
public static <T> Event<T> create(Function<T[], T> function) {
|
|
Class<?>[] arguments = TypeResolver.resolveRawArguments(Function.class, function.getClass());
|
|
Class<?>[] arguments = TypeResolver.resolveRawArguments(Function.class, function.getClass());
|
|
T[] array;
|
|
T[] array;
|
|
@@ -78,12 +78,16 @@ public final class EventFactory {
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SafeVarargs
|
|
@SafeVarargs
|
|
public static <T> Event<T> createInteractionResult(T... typeGetter) {
|
|
public static <T> Event<T> createInteractionResult(T... typeGetter) {
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
return createInteractionResult((Class<T>) typeGetter.getClass().getComponentType());
|
|
return createInteractionResult((Class<T>) typeGetter.getClass().getComponentType());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
public static <T> Event<T> createInteractionResult(Class<T> clazz) {
|
|
public static <T> Event<T> createInteractionResult(Class<T> clazz) {
|
|
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
|
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
|
@@ -122,12 +126,16 @@ public final class EventFactory {
|
|
}));
|
|
}));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SafeVarargs
|
|
@SafeVarargs
|
|
public static <T> Event<T> createInteractionResultHolder(T... typeGetter) {
|
|
public static <T> Event<T> createInteractionResultHolder(T... typeGetter) {
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
return createInteractionResultHolder((Class<T>) typeGetter.getClass().getComponentType());
|
|
return createInteractionResultHolder((Class<T>) typeGetter.getClass().getComponentType());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
public static <T> Event<T> createInteractionResultHolder(Class<T> clazz) {
|
|
public static <T> Event<T> createInteractionResultHolder(Class<T> clazz) {
|
|
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
|
return of(listeners -> (T) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{clazz}, new AbstractInvocationHandler() {
|
|
@@ -193,12 +201,16 @@ public final class EventFactory {
|
|
return event;
|
|
return event;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SafeVarargs
|
|
@SafeVarargs
|
|
public static <T> Event<Actor<T>> createActorLoop(T... typeGetter) {
|
|
public static <T> Event<Actor<T>> createActorLoop(T... typeGetter) {
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
if (typeGetter.length != 0) throw new IllegalStateException("array must be empty!");
|
|
return createActorLoop((Class<T>) typeGetter.getClass().getComponentType());
|
|
return createActorLoop((Class<T>) typeGetter.getClass().getComponentType());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
|
+ @ApiStatus.ScheduledForRemoval(inVersion = "2.0")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
@SuppressWarnings("UnstableApiUsage")
|
|
public static <T> Event<Actor<T>> createActorLoop(Class<T> clazz) {
|
|
public static <T> Event<Actor<T>> createActorLoop(Class<T> clazz) {
|
|
Event<Actor<T>> event = of(listeners -> (Actor<T>) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{Actor.class}, new AbstractInvocationHandler() {
|
|
Event<Actor<T>> event = of(listeners -> (Actor<T>) Proxy.newProxyInstance(EventFactory.class.getClassLoader(), new Class[]{Actor.class}, new AbstractInvocationHandler() {
|