Package com.alibaba.ttl
Class TtlWrappers
java.lang.Object
com.alibaba.ttl.TtlWrappers
Util methods for TTL Wrapper: wrap common
Functional Interface.
Note:
- all methods is
null-safe, when input parameter isnull, returnnull. - all wrap method skip wrap (aka. just return input parameter), when input parameter is already wrapped.
- Since:
- 2.11.4
- Author:
- Jerry Lee (oldratlee at gmail dot com), huangfei1101 (fei.hf at alibaba-inc dot com)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,U> BiConsumer<T, U> wrap(BiConsumer<T, U> consumer) Deprecated.static <T,U, R> BiFunction<T, U, R> wrap(BiFunction<T, U, R> fn) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapBiFunction(BiFunction)instead.static <T> Consumer<T>Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapConsumer(java.util.function.Consumer)instead.static <T,R> Function<T, R> Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapFunction(Function)instead.static <T> Supplier<T>Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapSupplier(Supplier)instead.static <T,U> BiConsumer<T, U> wrapBiConsumer(BiConsumer<T, U> consumer) wrapBiConsumerto TTL wrapper.static <T,U, R> BiFunction<T, U, R> wrapBiFunction(BiFunction<T, U, R> fn) wrapBiFunctionto TTL wrapper.static <T> Consumer<T>wrapConsumer(Consumer<T> consumer) wrapConsumerto TTL wrapper.static <T,R> Function<T, R> wrapFunction(Function<T, R> fn) wrapFunctionto TTL wrapper.static <T> Supplier<T>wrapSupplier(Supplier<T> supplier) wrapSupplierto TTL wrapper.
-
Method Details
-
wrapSupplier
@Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T> Supplier<T> wrapSupplier(@Nullable Supplier<T> supplier) wrapSupplierto TTL wrapper. -
wrap
@Deprecated @Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T> Supplier<T> wrap(@Nullable Supplier<T> supplier) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapSupplier(Supplier)instead.wrapSupplierto TTL wrapper. -
wrapConsumer
@Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T> Consumer<T> wrapConsumer(@Nullable Consumer<T> consumer) wrapConsumerto TTL wrapper. -
wrap
@Deprecated @Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T> Consumer<T> wrap(@Nullable Consumer<T> consumer) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapConsumer(java.util.function.Consumer)instead.wrapConsumerto TTL wrapper. -
wrapBiConsumer
@Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,U> BiConsumer<T,U> wrapBiConsumer(@Nullable BiConsumer<T, U> consumer) wrapBiConsumerto TTL wrapper.- Parameters:
consumer- inputBiConsumer- Returns:
- Wrapped
BiConsumer - Since:
- 2.12.4
- See Also:
-
wrap
@Deprecated @Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,U> BiConsumer<T,U> wrap(@Nullable BiConsumer<T, U> consumer) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapBiConsumer(BiConsumer)instead.wrap inputBiConsumerto TTL wrapper.- Parameters:
consumer- inputBiConsumer- Returns:
- Wrapped
BiConsumer - Since:
- 2.11.4
- See Also:
-
wrapFunction
@Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,R> Function<T,R> wrapFunction(@Nullable Function<T, R> fn) wrapFunctionto TTL wrapper. -
wrap
@Deprecated @Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,R> Function<T,R> wrap(@Nullable Function<T, R> fn) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapFunction(Function)instead.wrapFunctionto TTL wrapper. -
wrapBiFunction
@Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,U, BiFunction<T,R> U, wrapBiFunctionR> (@Nullable BiFunction<T, U, R> fn) wrapBiFunctionto TTL wrapper.- Parameters:
fn- inputBiFunction- Returns:
- Wrapped
BiFunction - Since:
- 2.12.4
- See Also:
-
wrap
@Deprecated @Nullable @Contract(value="null -> null; !null -> !null", pure=true) public static <T,U, BiFunction<T,R> U, wrapR> (@Nullable BiFunction<T, U, R> fn) Deprecated.overload methods using the same namewrapis not readable and have the type inference problems in some case; so usewrapBiFunction(BiFunction)instead.wrapBiFunctionto TTL wrapper.- Parameters:
fn- inputBiFunction- Returns:
- Wrapped
BiFunction - Since:
- 2.11.4
- See Also:
-
wrapis not readable and have the type inference problems in some case; so usewrapBiConsumer(BiConsumer)instead.