From f606fac7a4851ed841df715ef0d20ea9ee257c68 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Sun, 18 Oct 2020 17:16:04 +0200 Subject: [PATCH] Reformatted code and added documentation --- .../net/axay/kspigot/runnables/ChainableRunnables.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/axay/kspigot/runnables/ChainableRunnables.kt b/src/main/kotlin/net/axay/kspigot/runnables/ChainableRunnables.kt index 80b06464..3f3f9c4f 100644 --- a/src/main/kotlin/net/axay/kspigot/runnables/ChainableRunnables.kt +++ b/src/main/kotlin/net/axay/kspigot/runnables/ChainableRunnables.kt @@ -12,6 +12,9 @@ abstract class ChainedRunnablePart( protected abstract fun invoke(data: T): R + /** + * Begins execution of this chained runnable. + */ abstract fun execute() /** @@ -71,6 +74,7 @@ abstract class ChainedRunnablePart( next?.startCatching(result, exceptionClass, exceptionSync, exceptionHandler) } } + } class ChainedRunnablePartFirst( @@ -85,8 +89,7 @@ class ChainedRunnablePartFirst( exceptionClass: KClass, exceptionSync: Boolean, exceptionHandler: ((E) -> Unit)? - ) = - startCatching(Unit, exceptionClass, exceptionSync, exceptionHandler) + ) = startCatching(Unit, exceptionClass, exceptionSync, exceptionHandler) override fun invoke(data: Unit) = runnable.invoke() @@ -105,8 +108,7 @@ class ChainedRunnablePartThen( exceptionClass: KClass, exceptionSync: Boolean, exceptionHandler: ((E) -> Unit)? - ) = - previous.executeCatchingImpl(exceptionClass, exceptionSync, exceptionHandler) + ) = previous.executeCatchingImpl(exceptionClass, exceptionSync, exceptionHandler) override fun invoke(data: T) = runnable.invoke(data)