mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix comment
This commit is contained in:
parent
d0ec0a4b5a
commit
ac9d4cef37
@ -23,7 +23,7 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
|
|||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T, U> SerBiConsumer<T, U> multi(SerBiConsumer<T, U>... consumers) {
|
static <T, U> SerBiConsumer<T, U> multi(final SerBiConsumer<T, U>... consumers) {
|
||||||
return Stream.of(consumers).reduce(SerBiConsumer::andThen).orElseGet(() -> (o, q) -> {});
|
return Stream.of(consumers).reduce(SerBiConsumer::andThen).orElseGet(() -> (o, q) -> {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,9 +32,8 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
|
|||||||
*
|
*
|
||||||
* @param t the first input argument
|
* @param t the first input argument
|
||||||
* @param u the second input argument
|
* @param u the second input argument
|
||||||
* @throws Exception wrappered checked exceptions for easy using
|
* @throws Exception wrapped checked exceptions for easy using
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
void accepting(T t, U u) throws Exception;
|
void accepting(T t, U u) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,10 +43,10 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
|
|||||||
* @param u the second input argument
|
* @param u the second input argument
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default void accept(T t, U u) {
|
default void accept(final T t, final U u) {
|
||||||
try {
|
try {
|
||||||
accepting(t, u);
|
accepting(t, u);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +63,7 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
|
|||||||
* operation followed by the {@code after} operation
|
* operation followed by the {@code after} operation
|
||||||
* @throws NullPointerException if {@code after} is null
|
* @throws NullPointerException if {@code after} is null
|
||||||
*/
|
*/
|
||||||
default SerBiConsumer<T, U> andThen(SerBiConsumer<? super T, ? super U> after) {
|
default SerBiConsumer<T, U> andThen(final SerBiConsumer<? super T, ? super U> after) {
|
||||||
Objects.requireNonNull(after);
|
Objects.requireNonNull(after);
|
||||||
return (l, r) -> {
|
return (l, r) -> {
|
||||||
accepting(l, r);
|
accepting(l, r);
|
||||||
|
@ -21,9 +21,8 @@ public interface SerBiFunction<T, U, R> extends BiFunction<T, U, R>, Serializabl
|
|||||||
* @param t the first function argument
|
* @param t the first function argument
|
||||||
* @param u the second function argument
|
* @param u the second function argument
|
||||||
* @return the function result
|
* @return the function result
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
R applying(T t, U u) throws Exception;
|
R applying(T t, U u) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,10 +33,10 @@ public interface SerBiFunction<T, U, R> extends BiFunction<T, U, R>, Serializabl
|
|||||||
* @return the function result
|
* @return the function result
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default R apply(T t, U u) {
|
default R apply(final T t, final U u) {
|
||||||
try {
|
try {
|
||||||
return this.applying(t, u);
|
return this.applying(t, u);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -55,7 +54,7 @@ public interface SerBiFunction<T, U, R> extends BiFunction<T, U, R>, Serializabl
|
|||||||
* applies the {@code after} function
|
* applies the {@code after} function
|
||||||
* @throws NullPointerException if after is null
|
* @throws NullPointerException if after is null
|
||||||
*/
|
*/
|
||||||
default <V> SerBiFunction<T, U, V> andThen(SerFunction<? super R, ? extends V> after) {
|
default <V> SerBiFunction<T, U, V> andThen(final SerFunction<? super R, ? extends V> after) {
|
||||||
Objects.requireNonNull(after);
|
Objects.requireNonNull(after);
|
||||||
return (T t, U u) -> after.apply(this.apply(t, u));
|
return (T t, U u) -> after.apply(this.apply(t, u));
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,8 @@ public interface SerBiPredicate<T, U> extends BiPredicate<T, U>, Serializable {
|
|||||||
* @param u the second input argument
|
* @param u the second input argument
|
||||||
* @return {@code true} if the input arguments match the predicate,
|
* @return {@code true} if the input arguments match the predicate,
|
||||||
* otherwise {@code false}
|
* otherwise {@code false}
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
boolean testing(T t, U u) throws Exception;
|
boolean testing(T t, U u) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,10 +36,10 @@ public interface SerBiPredicate<T, U> extends BiPredicate<T, U>, Serializable {
|
|||||||
* otherwise {@code false}
|
* otherwise {@code false}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default boolean test(T t, U u) {
|
default boolean test(final T t, final U u) {
|
||||||
try {
|
try {
|
||||||
return testing(t, u);
|
return testing(t, u);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,7 +61,7 @@ public interface SerBiPredicate<T, U> extends BiPredicate<T, U>, Serializable {
|
|||||||
* AND of this predicate and the {@code other} predicate
|
* AND of this predicate and the {@code other} predicate
|
||||||
* @throws NullPointerException if other is null
|
* @throws NullPointerException if other is null
|
||||||
*/
|
*/
|
||||||
default SerBiPredicate<T, U> and(SerBiPredicate<? super T, ? super U> other) {
|
default SerBiPredicate<T, U> and(final SerBiPredicate<? super T, ? super U> other) {
|
||||||
Objects.requireNonNull(other);
|
Objects.requireNonNull(other);
|
||||||
return (T t, U u) -> test(t, u) && other.test(t, u);
|
return (T t, U u) -> test(t, u) && other.test(t, u);
|
||||||
}
|
}
|
||||||
@ -95,7 +94,7 @@ public interface SerBiPredicate<T, U> extends BiPredicate<T, U>, Serializable {
|
|||||||
* OR of this predicate and the {@code other} predicate
|
* OR of this predicate and the {@code other} predicate
|
||||||
* @throws NullPointerException if other is null
|
* @throws NullPointerException if other is null
|
||||||
*/
|
*/
|
||||||
default SerBiPredicate<T, U> or(SerBiPredicate<? super T, ? super U> other) {
|
default SerBiPredicate<T, U> or(final SerBiPredicate<? super T, ? super U> other) {
|
||||||
Objects.requireNonNull(other);
|
Objects.requireNonNull(other);
|
||||||
return (T t, U u) -> test(t, u) || other.test(t, u);
|
return (T t, U u) -> test(t, u) || other.test(t, u);
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,8 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
|
|||||||
* @param t the first function argument
|
* @param t the first function argument
|
||||||
* @param u the second function argument
|
* @param u the second function argument
|
||||||
* @return the function result
|
* @return the function result
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
T applying(T t, T u) throws Exception;
|
T applying(T t, T u) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,10 +34,10 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
|
|||||||
* @return the function result
|
* @return the function result
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default T apply(T t, T u) {
|
default T apply(final T t, final T u) {
|
||||||
try {
|
try {
|
||||||
return this.applying(t, u);
|
return this.applying(t, u);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,7 +52,7 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
|
|||||||
* according to the supplied {@code Comparator}
|
* according to the supplied {@code Comparator}
|
||||||
* @throws NullPointerException if the argument is null
|
* @throws NullPointerException if the argument is null
|
||||||
*/
|
*/
|
||||||
static <T> SerBinaryOperator<T> minBy(Comparator<? super T> comparator) {
|
static <T> SerBinaryOperator<T> minBy(final Comparator<? super T> comparator) {
|
||||||
Objects.requireNonNull(comparator);
|
Objects.requireNonNull(comparator);
|
||||||
return (a, b) -> comparator.compare(a, b) <= 0 ? a : b;
|
return (a, b) -> comparator.compare(a, b) <= 0 ? a : b;
|
||||||
}
|
}
|
||||||
@ -68,7 +67,7 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
|
|||||||
* according to the supplied {@code Comparator}
|
* according to the supplied {@code Comparator}
|
||||||
* @throws NullPointerException if the argument is null
|
* @throws NullPointerException if the argument is null
|
||||||
*/
|
*/
|
||||||
static <T> SerBinaryOperator<T> maxBy(Comparator<? super T> comparator) {
|
static <T> SerBinaryOperator<T> maxBy(final Comparator<? super T> comparator) {
|
||||||
Objects.requireNonNull(comparator);
|
Objects.requireNonNull(comparator);
|
||||||
return (a, b) -> comparator.compare(a, b) >= 0 ? a : b;
|
return (a, b) -> comparator.compare(a, b) >= 0 ? a : b;
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,8 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
|
|||||||
* Performs this operation on the given argument.
|
* Performs this operation on the given argument.
|
||||||
*
|
*
|
||||||
* @param t the input argument
|
* @param t the input argument
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
void accepting(T t) throws Exception;
|
void accepting(T t) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,10 +30,10 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
|
|||||||
* @param t the input argument
|
* @param t the input argument
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default void accept(T t) {
|
default void accept(final T t) {
|
||||||
try {
|
try {
|
||||||
accepting(t);
|
accepting(t);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,7 +46,7 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
|
|||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T> SerConsumer<T> multi(SerConsumer<T>... consumers) {
|
static <T> SerConsumer<T> multi(final SerConsumer<T>... consumers) {
|
||||||
return Stream.of(consumers).reduce(SerConsumer::andThen).orElseGet(() -> o -> {});
|
return Stream.of(consumers).reduce(SerConsumer::andThen).orElseGet(() -> o -> {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +62,7 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
|
|||||||
* operation followed by the {@code after} operation
|
* operation followed by the {@code after} operation
|
||||||
* @throws NullPointerException if {@code after} is null
|
* @throws NullPointerException if {@code after} is null
|
||||||
*/
|
*/
|
||||||
default SerConsumer<T> andThen(SerConsumer<? super T> after) {
|
default SerConsumer<T> andThen(final SerConsumer<? super T> after) {
|
||||||
Objects.requireNonNull(after);
|
Objects.requireNonNull(after);
|
||||||
return (T t) -> {
|
return (T t) -> {
|
||||||
accept(t);
|
accept(t);
|
||||||
|
@ -23,9 +23,8 @@ public interface SerConsumer3<P1, P2, P3> extends Serializable {
|
|||||||
* @param p1 参数一
|
* @param p1 参数一
|
||||||
* @param p2 参数二
|
* @param p2 参数二
|
||||||
* @param p3 参数三
|
* @param p3 参数三
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
void accepting(P1 p1, P2 p2, P3 p3) throws Exception;
|
void accepting(P1 p1, P2 p2, P3 p3) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,9 +19,8 @@ public interface SerFunction<T, R> extends Function<T, R>, Serializable {
|
|||||||
*
|
*
|
||||||
* @param t the function argument
|
* @param t the function argument
|
||||||
* @return the function result
|
* @return the function result
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
R applying(T t) throws Exception;
|
R applying(T t) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +22,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* @param t the input argument
|
* @param t the input argument
|
||||||
* @return {@code true} if the input argument matches the predicate,
|
* @return {@code true} if the input argument matches the predicate,
|
||||||
* otherwise {@code false}
|
* otherwise {@code false}
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
boolean testing(T t) throws Exception;
|
boolean testing(T t) throws Exception;
|
||||||
|
|
||||||
@ -34,10 +34,10 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* otherwise {@code false}
|
* otherwise {@code false}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default boolean test(T t) {
|
default boolean test(final T t) {
|
||||||
try {
|
try {
|
||||||
return testing(t);
|
return testing(t);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T> SerPredicate<T> multiAnd(SerPredicate<T>... predicates) {
|
static <T> SerPredicate<T> multiAnd(final SerPredicate<T>... predicates) {
|
||||||
return Stream.of(predicates).reduce(SerPredicate::and).orElseGet(() -> o -> true);
|
return Stream.of(predicates).reduce(SerPredicate::and).orElseGet(() -> o -> true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T> SerPredicate<T> multiOr(SerPredicate<T>... predicates) {
|
static <T> SerPredicate<T> multiOr(final SerPredicate<T>... predicates) {
|
||||||
return Stream.of(predicates).reduce(SerPredicate::or).orElseGet(() -> o -> false);
|
return Stream.of(predicates).reduce(SerPredicate::or).orElseGet(() -> o -> false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* @return a predicate that tests if two arguments are equal according
|
* @return a predicate that tests if two arguments are equal according
|
||||||
* to {@link Objects#equals(Object, Object)}
|
* to {@link Objects#equals(Object, Object)}
|
||||||
*/
|
*/
|
||||||
static <T> SerPredicate<T> isEqual(Object... targetRef) {
|
static <T> SerPredicate<T> isEqual(final Object... targetRef) {
|
||||||
return (null == targetRef)
|
return (null == targetRef)
|
||||||
? Objects::isNull
|
? Objects::isNull
|
||||||
: object -> Stream.of(targetRef).allMatch(target -> target.equals(object));
|
: object -> Stream.of(targetRef).allMatch(target -> target.equals(object));
|
||||||
@ -98,7 +98,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* AND of this predicate and the {@code other} predicate
|
* AND of this predicate and the {@code other} predicate
|
||||||
* @throws NullPointerException if other is null
|
* @throws NullPointerException if other is null
|
||||||
*/
|
*/
|
||||||
default SerPredicate<T> and(SerPredicate<? super T> other) {
|
default SerPredicate<T> and(final SerPredicate<? super T> other) {
|
||||||
Objects.requireNonNull(other);
|
Objects.requireNonNull(other);
|
||||||
return t -> test(t) && other.test(t);
|
return t -> test(t) && other.test(t);
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
|
|||||||
* OR of this predicate and the {@code other} predicate
|
* OR of this predicate and the {@code other} predicate
|
||||||
* @throws NullPointerException if other is null
|
* @throws NullPointerException if other is null
|
||||||
*/
|
*/
|
||||||
default SerPredicate<T> or(SerPredicate<? super T> other) {
|
default SerPredicate<T> or(final SerPredicate<? super T> other) {
|
||||||
Objects.requireNonNull(other);
|
Objects.requireNonNull(other);
|
||||||
return t -> test(t) || other.test(t);
|
return t -> test(t) || other.test(t);
|
||||||
}
|
}
|
||||||
|
@ -24,10 +24,9 @@ public interface SerRunnable extends Runnable, Serializable {
|
|||||||
* The general contract of the method <code>run</code> is that it may
|
* The general contract of the method <code>run</code> is that it may
|
||||||
* take any action whatsoever.
|
* take any action whatsoever.
|
||||||
*
|
*
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
* @see Thread#run()
|
* @see Thread#run()
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
void running() throws Exception;
|
void running() throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +44,7 @@ public interface SerRunnable extends Runnable, Serializable {
|
|||||||
default void run() {
|
default void run() {
|
||||||
try {
|
try {
|
||||||
running();
|
running();
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,7 +55,7 @@ public interface SerRunnable extends Runnable, Serializable {
|
|||||||
* @param serRunnableArray lambda
|
* @param serRunnableArray lambda
|
||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
static SerRunnable multi(SerRunnable... serRunnableArray) {
|
static SerRunnable multi(final SerRunnable... serRunnableArray) {
|
||||||
return () -> Stream.of(serRunnableArray).forEach(SerRunnable::run);
|
return () -> Stream.of(serRunnableArray).forEach(SerRunnable::run);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,9 +19,8 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
|
|||||||
* Gets a result.
|
* Gets a result.
|
||||||
*
|
*
|
||||||
* @return a result
|
* @return a result
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
T getting() throws Exception;
|
T getting() throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +32,7 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
|
|||||||
default T get() {
|
default T get() {
|
||||||
try {
|
try {
|
||||||
return getting();
|
return getting();
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,7 +45,7 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
|
|||||||
* @return lambda
|
* @return lambda
|
||||||
*/
|
*/
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
static <T> SerSupplier<T> last(SerSupplier<T>... serSups) {
|
static <T> SerSupplier<T> last(final SerSupplier<T>... serSups) {
|
||||||
return Stream.of(serSups).reduce((l, r) -> r).orElseGet(() -> () -> null);
|
return Stream.of(serSups).reduce((l, r) -> r).orElseGet(() -> () -> null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,8 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
|
|||||||
*
|
*
|
||||||
* @param t the function argument
|
* @param t the function argument
|
||||||
* @return the function result
|
* @return the function result
|
||||||
* @throws Exception wrappered checked exceptions
|
* @throws Exception wrapped checked exceptions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("all")
|
|
||||||
T applying(T t) throws Exception;
|
T applying(T t) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,10 +31,10 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
|
|||||||
* @return the function result
|
* @return the function result
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
default T apply(T t) {
|
default T apply(final T t) {
|
||||||
try {
|
try {
|
||||||
return applying(t);
|
return applying(t);
|
||||||
} catch (Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new UtilException(e);
|
throw new UtilException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,7 +60,7 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
|
|||||||
* @return identity after casting
|
* @return identity after casting
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
static <T, R, F extends Function<T, R>> SerUnaryOperator<T> casting(F function) {
|
static <T, R, F extends Function<T, R>> SerUnaryOperator<T> casting(final F function) {
|
||||||
return t -> (T) function.apply(t);
|
return t -> (T) function.apply(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user