DATATYPE - The callable result type.PARAMTYPE - The parameter type@Immutable public class AdapterThrowingRunnableToCallableWithParameter<DATATYPE,PARAMTYPE> extends Object implements IThrowingCallableWithParameter<DATATYPE,PARAMTYPE>
IThrowingRunnable into an
IThrowingCallable.| Constructor and Description |
|---|
AdapterThrowingRunnableToCallableWithParameter(IThrowingRunnableWithParameter<PARAMTYPE> aRunnable) |
AdapterThrowingRunnableToCallableWithParameter(IThrowingRunnableWithParameter<PARAMTYPE> aRunnable,
DATATYPE aResult) |
| Modifier and Type | Method and Description |
|---|---|
DATATYPE |
call(PARAMTYPE aParam)
The call back method to be called.
|
static <PARAMTYPE> |
createAdapter(IThrowingRunnableWithParameter<PARAMTYPE> aRunnable)
Create a callable that always returns
null. |
static <DATATYPE,PARAMTYPE> |
createAdapter(IThrowingRunnableWithParameter<PARAMTYPE> aRunnable,
DATATYPE aResult)
Create a callable that always returns the passed value.
|
String |
toString() |
public AdapterThrowingRunnableToCallableWithParameter(@Nonnull IThrowingRunnableWithParameter<PARAMTYPE> aRunnable)
public AdapterThrowingRunnableToCallableWithParameter(@Nonnull IThrowingRunnableWithParameter<PARAMTYPE> aRunnable, @Nullable DATATYPE aResult)
@Nullable public DATATYPE call(PARAMTYPE aParam) throws Exception
IThrowingCallableWithParametercall in interface IThrowingCallableWithParameter<DATATYPE,PARAMTYPE>aParam - The parameter to be passed in. May be null or non-
null depending on the implementation.null or non- null
depending on the implementation.Exception - in case something goes wrong@Nonnull public static <PARAMTYPE> AdapterThrowingRunnableToCallableWithParameter<Object,PARAMTYPE> createAdapter(@Nonnull IThrowingRunnableWithParameter<PARAMTYPE> aRunnable)
null.aRunnable - The runnable to be executed.AdapterThrowingRunnableToCallableWithParameter
object.@Nonnull public static <DATATYPE,PARAMTYPE> AdapterThrowingRunnableToCallableWithParameter<DATATYPE,PARAMTYPE> createAdapter(@Nonnull IThrowingRunnableWithParameter<PARAMTYPE> aRunnable, @Nullable DATATYPE aResult)
aRunnable - The runnable to be executed.aResult - The expected result from calling Callable.call() .
May be null.AdapterThrowingRunnableToCallableWithParameter
object.Copyright © 2006–2014 phloc systems. All rights reserved.