Package com.alibaba.ttl
Class TtlUnwrap
- java.lang.Object
-
- com.alibaba.ttl.TtlUnwrap
-
public class TtlUnwrap extends Object
Util methods for TTL Wrapper: unwrap TTL Wrapper and check TTL Wrapper.Note:
all methods isnull-safe, when input parameter isnull, returnnull.Implementation Note:
The util methods in this class should have been insideTtlWrappers.
But forJava 6support, it's required splitting the util methods which involvedJava 8fromTtlWrappers. In order to avoid loadingJava 8class (eg:Consumer,Supplier), when invoking any methods ofTtlWrappers.- Since:
- 2.11.4
- Author:
- Jerry Lee (oldratlee at gmail dot com)
- See Also:
TtlRunnable,TtlCallable,TtlExecutors,TtlForkJoinPoolHelper,TtlWrappers
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> booleanisWrapper(T obj)check the input object is aTtlWrapperor not.static <T> Tunwrap(T obj)Generic unwrap method, unwrapTtlWrapperto the original/underneath one.
-
-
-
Method Detail
-
unwrap
@Nullable public static <T> T unwrap(@Nullable T obj)
Generic unwrap method, unwrapTtlWrapperto the original/underneath one.this method is
null-safe, when input parameter isnull, returnnull; if input parameter is not aTtlWrapperjust return input.- Since:
- 2.11.4
- See Also:
TtlRunnable.unwrap(Runnable),TtlCallable.unwrap(java.util.concurrent.Callable),TtlExecutors.unwrap(java.util.concurrent.Executor),TtlExecutors.unwrap(java.util.concurrent.ThreadFactory),TtlForkJoinPoolHelper.unwrap(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory),TtlWrappers.wrap(java.util.function.Supplier),TtlWrappers.wrap(java.util.function.Consumer),TtlWrappers.wrap(java.util.function.BiConsumer),TtlWrappers.wrap(java.util.function.Function),TtlWrappers.wrap(java.util.function.BiFunction),isWrapper(Object)
-
isWrapper
public static <T> boolean isWrapper(@Nullable T obj)
check the input object is aTtlWrapperor not.- Since:
- 2.11.4
- See Also:
unwrap(Object)
-
-