style: reformatted codes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user