style: reformatted codes

This commit is contained in:
zihluwang
2025-06-18 13:57:32 +08:00
parent 022c1c241a
commit 0e87c0f336
11 changed files with 81 additions and 46 deletions
+3 -2
View File
@@ -1,8 +1,9 @@
# Module `devkit-utils`
# Common Toolbox
## Introduction
This module provides a set of utilities to streamline Java codes.
Common Toolbox is a Java SE utility library, that provides a collection of utility to streamline
your Java coding experience.
## Features
@@ -61,9 +61,11 @@ public final class CollectionUtil {
* {@code maxSize} is less than zero, or
* {@code collectionFactory} is {@code null}
*/
public static <T, C extends Collection<T>> List<C> chunk(C originalCollection,
int maxSize,
Supplier<C> collectionFactory) {
public static <T, C extends Collection<T>> List<C> chunk(
C originalCollection,
int maxSize,
Supplier<C> collectionFactory
) {
// check inputs
if (Objects.isNull(originalCollection)) {
throw new IllegalArgumentException("Collection must not be null.");
@@ -122,7 +122,7 @@ public final class RangeUtil {
return IntStream.range(start, end);
} else {
// Descending range (exclusive of end)
return IntStream.iterate(start, n -> n > end, n -> n - 1);
return IntStream.iterate(start, (n) -> n > end, (n) -> n - 1);
}
}