fix comment

This commit is contained in:
Looly 2022-09-07 16:36:03 +08:00
parent d0ec0a4b5a
commit ac9d4cef37
11 changed files with 44 additions and 54 deletions

View File

@ -23,7 +23,7 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
* @return lambda
*/
@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) -> {});
}
@ -32,9 +32,8 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
*
* @param t the first 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;
/**
@ -44,10 +43,10 @@ public interface SerBiConsumer<T, U> extends BiConsumer<T, U>, Serializable {
* @param u the second input argument
*/
@Override
default void accept(T t, U u) {
default void accept(final T t, final U u) {
try {
accepting(t, u);
} catch (Exception e) {
} catch (final Exception 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
* @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);
return (l, r) -> {
accepting(l, r);

View File

@ -21,9 +21,8 @@ public interface SerBiFunction<T, U, R> extends BiFunction<T, U, R>, Serializabl
* @param t the first function argument
* @param u the second function argument
* @return the function result
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
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
*/
@Override
default R apply(T t, U u) {
default R apply(final T t, final U u) {
try {
return this.applying(t, u);
} catch (Exception e) {
} catch (final Exception 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
* @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);
return (T t, U u) -> after.apply(this.apply(t, u));
}

View File

@ -23,9 +23,8 @@ public interface SerBiPredicate<T, U> extends BiPredicate<T, U>, Serializable {
* @param u the second input argument
* @return {@code true} if the input arguments match the predicate,
* otherwise {@code false}
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
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}
*/
@Override
default boolean test(T t, U u) {
default boolean test(final T t, final U u) {
try {
return testing(t, u);
} catch (Exception e) {
} catch (final Exception 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
* @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);
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
* @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);
return (T t, U u) -> test(t, u) || other.test(t, u);
}

View File

@ -22,9 +22,8 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
* @param t the first function argument
* @param u the second function argument
* @return the function result
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
T applying(T t, T u) throws Exception;
/**
@ -35,10 +34,10 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
* @return the function result
*/
@Override
default T apply(T t, T u) {
default T apply(final T t, final T u) {
try {
return this.applying(t, u);
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -53,7 +52,7 @@ public interface SerBinaryOperator<T> extends BinaryOperator<T>, Serializable {
* according to the supplied {@code Comparator}
* @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);
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}
* @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);
return (a, b) -> comparator.compare(a, b) >= 0 ? a : b;
}

View File

@ -20,9 +20,8 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
* Performs this operation on the given argument.
*
* @param t the input argument
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
void accepting(T t) throws Exception;
/**
@ -31,10 +30,10 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
* @param t the input argument
*/
@Override
default void accept(T t) {
default void accept(final T t) {
try {
accepting(t);
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -47,7 +46,7 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
* @return lambda
*/
@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 -> {});
}
@ -63,7 +62,7 @@ public interface SerConsumer<T> extends Consumer<T>, Serializable {
* operation followed by the {@code after} operation
* @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);
return (T t) -> {
accept(t);

View File

@ -23,9 +23,8 @@ public interface SerConsumer3<P1, P2, P3> extends Serializable {
* @param p1 参数一
* @param p2 参数二
* @param p3 参数三
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
void accepting(P1 p1, P2 p2, P3 p3) throws Exception;
/**

View File

@ -19,9 +19,8 @@ public interface SerFunction<T, R> extends Function<T, R>, Serializable {
*
* @param t the function argument
* @return the function result
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
R applying(T t) throws Exception;
/**

View File

@ -22,7 +22,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
* @param t the input argument
* @return {@code true} if the input argument matches the predicate,
* otherwise {@code false}
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
boolean testing(T t) throws Exception;
@ -34,10 +34,10 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
* otherwise {@code false}
*/
@Override
default boolean test(T t) {
default boolean test(final T t) {
try {
return testing(t);
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -50,7 +50,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
* @return lambda
*/
@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);
}
@ -62,7 +62,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
* @return lambda
*/
@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);
}
@ -76,7 +76,7 @@ public interface SerPredicate<T> extends Predicate<T>, Serializable {
* @return a predicate that tests if two arguments are equal according
* to {@link Objects#equals(Object, Object)}
*/
static <T> SerPredicate<T> isEqual(Object... targetRef) {
static <T> SerPredicate<T> isEqual(final Object... targetRef) {
return (null == targetRef)
? Objects::isNull
: 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
* @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);
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
* @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);
return t -> test(t) || other.test(t);
}

View File

@ -24,10 +24,9 @@ public interface SerRunnable extends Runnable, Serializable {
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
* @see Thread#run()
*/
@SuppressWarnings("all")
void running() throws Exception;
/**
@ -45,7 +44,7 @@ public interface SerRunnable extends Runnable, Serializable {
default void run() {
try {
running();
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -56,7 +55,7 @@ public interface SerRunnable extends Runnable, Serializable {
* @param serRunnableArray lambda
* @return lambda
*/
static SerRunnable multi(SerRunnable... serRunnableArray) {
static SerRunnable multi(final SerRunnable... serRunnableArray) {
return () -> Stream.of(serRunnableArray).forEach(SerRunnable::run);
}

View File

@ -19,9 +19,8 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
* Gets a result.
*
* @return a result
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
T getting() throws Exception;
/**
@ -33,7 +32,7 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
default T get() {
try {
return getting();
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -46,7 +45,7 @@ public interface SerSupplier<T> extends Supplier<T>, Serializable {
* @return lambda
*/
@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);
}

View File

@ -20,9 +20,8 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
*
* @param t the function argument
* @return the function result
* @throws Exception wrappered checked exceptions
* @throws Exception wrapped checked exceptions
*/
@SuppressWarnings("all")
T applying(T t) throws Exception;
/**
@ -32,10 +31,10 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
* @return the function result
*/
@Override
default T apply(T t) {
default T apply(final T t) {
try {
return applying(t);
} catch (Exception e) {
} catch (final Exception e) {
throw new UtilException(e);
}
}
@ -61,7 +60,7 @@ public interface SerUnaryOperator<T> extends UnaryOperator<T>, Serializable {
* @return identity after casting
*/
@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);
}