T
- the type of the result.public final class Runnables extends Object
Modifier and Type | Method and Description |
---|---|
static Runnable |
named(runnable : Runnable,
name : String)
Create a wrapper with a specific thread name.
|
static <T> SreCallable<T> |
protectCallable(callable : Callable<T>,
logger : Logger)
Create a task with the given callable.
|
static <T> SreConsumer<T> |
protectConsumer(consumer : Consumer<? super T>,
logger : Logger)
Create a task with the given consumer.
|
static SreRunnable |
protectRunnable(runnable : Runnable,
logger : Logger)
Create a task with the given runnable.
|
@Pure
public static def
protectRunnable(runnable : Runnable,
logger : Logger) : SreRunnable
Runnables
runnable
- the runnable.logger
- the logger to use.@Pure public staticdef
protectCallable(callable : Callable<T>, logger : Logger) : SreCallable<T>with
<T>
Runnables
T
- the type of the returned value.callable
- the callable.logger
- the logger to use.@Pure public staticdef
protectConsumer(consumer : Consumer<? super T>, logger : Logger) : SreConsumer<T>with
<T>
Runnables
T
- the type of the returned value.consumer
- the consumer.logger
- the logger to use.@Pure
public static def
named(runnable : Runnable,
name : String) : Runnable
Runnables
runnable
- the task to wrap.name
- the new name of the associated, if not null
.Copyright © 2021 the original authors or authors.