From 13481f81245e36dd30917fd5f496da57b5e0bea1 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Sat, 28 Aug 2021 02:26:57 +0300 Subject: [PATCH 1/3] docs: add missing documentation for generic parameters of `ReferenceWrapper` --- .../primitive/wrapper/ReferenceWrapper.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/primitive/wrapper/ReferenceWrapper.java b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/primitive/wrapper/ReferenceWrapper.java index fc957950..339087e9 100644 --- a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/primitive/wrapper/ReferenceWrapper.java +++ b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/primitive/wrapper/ReferenceWrapper.java @@ -10,6 +10,8 @@ /** * Wrapper of a reference. + * + * @param type of reference */ public interface ReferenceWrapper { @@ -17,6 +19,7 @@ public interface ReferenceWrapper { * Creates new simple reference wrapper. * * @param value initial reference of int wrapper + * @param type of reference * @return created reference wrapper */ static ReferenceWrapper create(final T value) { @@ -26,6 +29,7 @@ static ReferenceWrapper create(final T value) { /** * Creates new simple reference wrapper with initial value set to {@code null}. * + * @param type of reference * @return created reference wrapper */ static ReferenceWrapper create() { @@ -36,6 +40,7 @@ static ReferenceWrapper create() { * Creates new atomic reference wrapper. * * @param value initial value of reference wrapper + * @param type of reference * @return created reference wrapper */ static ReferenceWrapper createAtomic(final T value) { @@ -45,6 +50,7 @@ static ReferenceWrapper createAtomic(final T value) { /** * Creates new atomic reference wrapper with initial value set to {@code null}. * + * @param type of reference * @return created reference wrapper */ static ReferenceWrapper createAtomic() { @@ -109,6 +115,8 @@ static ReferenceWrapper createAtomic() { /** * {@link ReferenceWrapper} implementation based on primitive reference. + * + * @param type of reference */ @ToString @EqualsAndHashCode @@ -166,6 +174,8 @@ public T accumulateAndGet(final T updateValue, final @NonNull BinaryOperator /** * {@link ReferenceWrapper} implementation based on {@link AtomicReference}. + * + * @param type of reference */ @ToString @EqualsAndHashCode From ef252f89790479c9f1fee9148e317dda5c94628f Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Sat, 28 Aug 2021 02:28:40 +0300 Subject: [PATCH 2/3] docs: remove redundant `
`s in `BlackHole`

---
 .../java/ru/progrm_jarvis/javacommons/util/BlackHole.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/BlackHole.java b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/BlackHole.java
index 1f078c16..4f8bcce7 100644
--- a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/BlackHole.java
+++ b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/BlackHole.java
@@ -11,8 +11,8 @@ public class BlackHole {
     /**
      * Consumes the provided value without any visible side effects.
      * This may be used for scenarios when an arbitrary expression has to be treated as a statement,
-     * for example{@code String.class}
is an expression but not a statement - * but
{@code BlackHole.consume(String.class)}
is. + * for example{@code String.class} is an expression but not a statement + * but {@code BlackHole.consume(String.class)} is. * * @param value consumed value * @param type of consumed value From b757fd77514875fecb9391a8b186e53c8e3041b6 Mon Sep 17 00:00:00 2001 From: Petr Portnov Date: Sat, 28 Aug 2021 02:33:43 +0300 Subject: [PATCH 3/3] docs: fix add missing `@param ` to `*EnumCollectors` --- .../util/stream/AutoEnumCollectors.java | 5 ++++- .../javacommons/util/stream/EnumCollectors.java | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/AutoEnumCollectors.java b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/AutoEnumCollectors.java index a554b8a9..01001dc6 100644 --- a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/AutoEnumCollectors.java +++ b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/AutoEnumCollectors.java @@ -14,7 +14,7 @@ /** * {@link Collector Collectors} for use with enums with automatic type inference. - * This delegates its logic to the corresponding methods of {@link AutoEnumCollectors} + * This delegates its logic to the corresponding methods of {@link EnumCollectors} * but infers enum types via {@link TypeHints#resolve(Object[]) type hints} * this leads to insignificant overhead due to empty-array allocation cost * thus it is recommended to provide types explicitly in critical sections. @@ -29,7 +29,9 @@ public class AutoEnumCollectors { * @param valueMapper mapping function used to convert the elements into values * @param merger function used to handle duplicate values * @param typeHint array used for enum-type discovery + * @param type of the input elements * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ @SafeVarargs @@ -49,6 +51,7 @@ public class AutoEnumCollectors { * @param merger function used to handle duplicate values * @param typeHint array used for enum-type discovery * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ @SafeVarargs diff --git a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/EnumCollectors.java b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/EnumCollectors.java index d86977f7..23a7eafa 100644 --- a/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/EnumCollectors.java +++ b/java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/EnumCollectors.java @@ -31,11 +31,13 @@ public class EnumCollectors { /** * Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}. * - * @param type of the enum * @param type type object of the enum * @param keyMapper mapping function used to convert the elements into enum-keys * @param valueMapper mapping function used to convert the elements into values * @param merger function used to handle duplicate values + * @param type of the input elements + * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ public , V> @NotNull Collector> toEnumMap( @@ -54,7 +56,9 @@ public class EnumCollectors { * @param valueMapper mapping function used to convert the elements into values * @param merger function used to handle duplicate values * @param typeHint array used for enum-type discovery + * @param type of the input elements * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ @SafeVarargs @@ -70,10 +74,12 @@ public class EnumCollectors { /** * Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}. * - * @param type of the enum * @param type type object of the enum * @param keyMapper mapping function used to convert the elements into enum-keys * @param valueMapper mapping function used to convert the elements into values + * @param type of the input elements + * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ public , V> @NotNull Collector> toEnumMap( @@ -87,9 +93,10 @@ public class EnumCollectors { /** * Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}. * - * @param type of the enum * @param type type object of the enum * @param valueMapper mapping function used to convert the elements into values + * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ public , V> @NotNull Collector> toEnumMap( @@ -102,10 +109,11 @@ public class EnumCollectors { /** * Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}. * - * @param type of the enum * @param type type object of the enum * @param valueMapper mapping function used to convert the elements into values * @param merger function used to handle duplicate values + * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ public , V> @NotNull Collector> toEnumMap( @@ -123,6 +131,7 @@ public class EnumCollectors { * @param merger function used to handle duplicate values * @param typeHint array used for enum-type discovery * @param type of the enum + * @param type of map values * @return a collector collecting al its elements into an enum-map */ @SafeVarargs