Skip to content

Commit faf8e79

Browse files
committed
docs: improve javadoc of TtlWrapper/TtlWrappers 📚
1 parent f40ad25 commit faf8e79

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

ttl-core/src/main/java/com/alibaba/ttl3/TtlWrappers.java

+17-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
import com.alibaba.crr.composite.Backup;
44
import com.alibaba.crr.composite.Capture;
5-
import com.alibaba.ttl3.executor.TtlExecutors;
65
import com.alibaba.ttl3.spi.TtlEnhanced;
76
import com.alibaba.ttl3.spi.TtlWrapper;
87
import edu.umd.cs.findbugs.annotations.NonNull;
98
import edu.umd.cs.findbugs.annotations.Nullable;
109
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1110
import org.jetbrains.annotations.Contract;
1211

13-
import java.util.concurrent.Callable;
1412
import java.util.function.*;
1513

1614
import static com.alibaba.ttl3.transmitter.Transmitter.*;
@@ -30,15 +28,18 @@
3028
* <ul>
3129
* <li>all methods is {@code null}-safe, when input parameter is {@code null}, return {@code null}.</li>
3230
* <li>all wrap method skip wrapping (aka. just return input parameter), when input parameter is already wrapped.</li>
33-
* <li>the wrap methods for {@link Runnable} and {@link java.util.concurrent.Callable} are provided
34-
* by {@link TtlRunnable#get(Runnable)} and {@link TtlCallable#get(Callable)}.</li>
31+
* <li>the wrap methods for {@link Runnable} and {@link java.util.concurrent.Callable Callable} are provided
32+
* by {@link TtlRunnable#get(Runnable)} and {@link TtlCallable#get(java.util.concurrent.Callable) TtlCallable.get(Callable)}.</li>
33+
* <li>the wrap methods for {@link java.util.concurrent.Executor Executor} are provided
34+
* by {@link com.alibaba.ttl3.executor.TtlExecutors TtlExecutors}.</li>
3535
* </ul>
3636
*
3737
* @author Jerry Lee (oldratlee at gmail dot com)
3838
* @author huangfei1101 (fei.hf at alibaba-inc dot com)
3939
* @see TtlRunnable
4040
* @see TtlCallable
4141
* @see TtlWrapper
42+
* @see com.alibaba.ttl3.executor.TtlExecutors TtlExecutors
4243
*/
4344
public final class TtlWrappers {
4445
/**
@@ -122,17 +123,23 @@ public static <T, U, R> BiFunction<T, U, R> wrapBiFunction(@Nullable BiFunction<
122123
* this method is {@code null}-safe, when input parameter is {@code null}, return {@code null};
123124
* if input parameter is not a {@link TtlWrapper} just return input.
124125
*
125-
* @see TtlRunnable#unwrap(Runnable)
126-
* @see TtlCallable#unwrap(java.util.concurrent.Callable)
127-
* @see TtlExecutors#unwrapTtlExecutor(java.util.concurrent.Executor)
128-
* @see TtlExecutors#unwrapDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory)
129-
* @see TtlExecutors#unwrapDisableInheritableForkJoinWorkerThreadFactory(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory)
130-
* @see TtlExecutors#unwrapTtlRunnableUnwrapComparator(java.util.Comparator)
131126
* @see TtlWrappers#wrapSupplier(Supplier)
132127
* @see TtlWrappers#wrapConsumer(Consumer)
133128
* @see TtlWrappers#wrapBiConsumer(BiConsumer)
134129
* @see TtlWrappers#wrapFunction(Function)
135130
* @see TtlWrappers#wrapBiFunction(BiFunction)
131+
* @see TtlRunnable#get(Runnable)
132+
* @see TtlCallable#get(java.util.concurrent.Callable) TtlCallable.get(Callable)
133+
* @see com.alibaba.ttl3.executor.TtlExecutors#getTtlExecutor(java.util.concurrent.Executor) TtlExecutors.getTtlExecutor(Executor)
134+
* @see com.alibaba.ttl3.executor.TtlExecutors#getTtlExecutorService(java.util.concurrent.ExecutorService) TtlExecutors.getTtlExecutorService(ExecutorService)
135+
* @see com.alibaba.ttl3.executor.TtlExecutors#getDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory) TtlExecutors.getDisableInheritableThreadFactory(ThreadFactory)
136+
* @see com.alibaba.ttl3.executor.TtlExecutors#getDisableInheritableForkJoinWorkerThreadFactory(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory) TtlExecutors.getDisableInheritableForkJoinWorkerThreadFactory(ForkJoinWorkerThreadFactory)
137+
* @see TtlRunnable#unwrap(Runnable)
138+
* @see TtlCallable#unwrap(java.util.concurrent.Callable) TtlCallable.unwrap(Callable)
139+
* @see com.alibaba.ttl3.executor.TtlExecutors#unwrapTtlExecutor(java.util.concurrent.Executor) TtlExecutors.unwrapTtlExecutor(Executor)
140+
* @see com.alibaba.ttl3.executor.TtlExecutors#unwrapDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory) TtlExecutors.unwrapDisableInheritableThreadFactory(ThreadFactory)
141+
* @see com.alibaba.ttl3.executor.TtlExecutors#unwrapDisableInheritableForkJoinWorkerThreadFactory(java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory) TtlExecutors.unwrapDisableInheritableForkJoinWorkerThreadFactory(ForkJoinWorkerThreadFactory)
142+
* @see com.alibaba.ttl3.executor.TtlExecutors#unwrapTtlRunnableUnwrapComparator(java.util.Comparator) TtlExecutors.unwrapTtlRunnableUnwrapComparator(Comparator)
136143
* @see #isWrapper(Object)
137144
*/
138145
@Nullable

ttl-core/src/main/java/com/alibaba/ttl3/spi/TtlWrapper.java

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
package com.alibaba.ttl3.spi;
22

3-
import com.alibaba.ttl3.executor.TtlExecutors;
43
import edu.umd.cs.findbugs.annotations.NonNull;
54

6-
import java.util.concurrent.ExecutorService;
7-
85
/**
96
* Ttl Wrapper interface.
107
* <p>
118
* Used to mark wrapper types, for example:
129
* <ul>
13-
* <li>{@link com.alibaba.ttl3.TtlCallable TtlCallable}
14-
* <li>{@code TtlExecutors} created by util method
15-
* {@link TtlExecutors#getTtlExecutorService(ExecutorService)} getTtlExecutorService}
16-
* <li>{@code DisableInheritableThreadFactory} created by util method
17-
* {@link TtlExecutors#getDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory) getDisableInheritableThreadFactory}
10+
* <li>{@link com.alibaba.ttl3.TtlRunnable TtlRunnable}s, {@link com.alibaba.ttl3.TtlCallable TtlCallable}s
11+
* <li>{@code TtlWrappers} created by util methods {@code wrap*()} of class
12+
* {@link com.alibaba.ttl3.TtlWrappers TtlWrappers},
13+
* e.g. {@link com.alibaba.ttl3.TtlWrappers#wrapSupplier(java.util.function.Supplier) wrapSupplier}
14+
* <li>{@code TtlExecutors} created by util methods {@code get*()} of class
15+
* {@link com.alibaba.ttl3.executor.TtlExecutors TtlExecutors},
16+
* e.g. {@link com.alibaba.ttl3.executor.TtlExecutors#getTtlExecutorService(java.util.concurrent.ExecutorService) getTtlExecutorService}
17+
* <li>{@code DisableInheritableThreadFactories} created by util method
18+
* {@link com.alibaba.ttl3.executor.TtlExecutors#getDisableInheritableThreadFactory(java.util.concurrent.ThreadFactory) getDisableInheritableThreadFactory}
1819
* </ul>
1920
*
2021
* @author Jerry Lee (oldratlee at gmail dot com)
2122
* @see com.alibaba.ttl3.TtlWrappers#unwrap
22-
* @see com.alibaba.ttl3.TtlCallable
2323
* @see com.alibaba.ttl3.TtlRunnable
24+
* @see com.alibaba.ttl3.TtlCallable
25+
* @see com.alibaba.ttl3.TtlWrappers
2426
* @see com.alibaba.ttl3.executor.TtlExecutors
2527
*/
2628
public interface TtlWrapper<T> extends TtlEnhanced {
2729
/**
2830
* unwrap {@link TtlWrapper} to the original/underneath one.
2931
*
30-
* @see com.alibaba.ttl3.TtlWrappers#unwrap(Object)
32+
* @see com.alibaba.ttl3.TtlWrappers#unwrap
3133
*/
3234
@NonNull
3335
T unwrap();

0 commit comments

Comments
 (0)