Skip to content

Commit 41e5685

Browse files
authored
Merge pull request #236 from JarvisCraft/1.0.0-rc.5
2 parents 6dd316b + f218977 commit 41e5685

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

java-commons/src/main/java/ru/progrm_jarvis/javacommons/primitive/wrapper/ReferenceWrapper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010

1111
/**
1212
* Wrapper of a reference.
13+
*
14+
* @param <T> type of reference
1315
*/
1416
public interface ReferenceWrapper<T> {
1517

1618
/**
1719
* Creates new simple reference wrapper.
1820
*
1921
* @param value initial reference of int wrapper
22+
* @param <T> type of reference
2023
* @return created reference wrapper
2124
*/
2225
static <T> ReferenceWrapper<T> create(final T value) {
@@ -26,6 +29,7 @@ static <T> ReferenceWrapper<T> create(final T value) {
2629
/**
2730
* Creates new simple reference wrapper with initial value set to {@code null}.
2831
*
32+
* @param <T> type of reference
2933
* @return created reference wrapper
3034
*/
3135
static <T> ReferenceWrapper<T> create() {
@@ -36,6 +40,7 @@ static <T> ReferenceWrapper<T> create() {
3640
* Creates new atomic reference wrapper.
3741
*
3842
* @param value initial value of reference wrapper
43+
* @param <T> type of reference
3944
* @return created reference wrapper
4045
*/
4146
static <T> ReferenceWrapper<T> createAtomic(final T value) {
@@ -45,6 +50,7 @@ static <T> ReferenceWrapper<T> createAtomic(final T value) {
4550
/**
4651
* Creates new atomic reference wrapper with initial value set to {@code null}.
4752
*
53+
* @param <T> type of reference
4854
* @return created reference wrapper
4955
*/
5056
static <T> ReferenceWrapper<T> createAtomic() {
@@ -109,6 +115,8 @@ static <T> ReferenceWrapper<T> createAtomic() {
109115

110116
/**
111117
* {@link ReferenceWrapper} implementation based on primitive reference.
118+
*
119+
* @param <T> type of reference
112120
*/
113121
@ToString
114122
@EqualsAndHashCode
@@ -166,6 +174,8 @@ public T accumulateAndGet(final T updateValue, final @NonNull BinaryOperator<T>
166174

167175
/**
168176
* {@link ReferenceWrapper} implementation based on {@link AtomicReference}.
177+
*
178+
* @param <T> type of reference
169179
*/
170180
@ToString
171181
@EqualsAndHashCode

java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/BlackHole.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public class BlackHole {
1111
/**
1212
* Consumes the provided value without any visible side effects.
1313
* This may be used for scenarios when an arbitrary expression has to be treated as a statement,
14-
* for example{@code String.class}</pre> is an expression but not a statement
15-
* but <pre>{@code BlackHole.consume(String.class)}</pre> is.
14+
* for example{@code String.class} is an expression but not a statement
15+
* but {@code BlackHole.consume(String.class)} is.
1616
*
1717
* @param value consumed value
1818
* @param <T> type of consumed value

java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/AutoEnumCollectors.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/**
1616
* {@link Collector Collectors} for use with enums with automatic type inference.
17-
* This delegates its logic to the corresponding methods of {@link AutoEnumCollectors}
17+
* This delegates its logic to the corresponding methods of {@link EnumCollectors}
1818
* but infers enum types via {@link TypeHints#resolve(Object[]) type hints}
1919
* this leads to insignificant overhead due to empty-array allocation cost
2020
* thus it is recommended to provide types explicitly in critical sections.
@@ -29,7 +29,9 @@ public class AutoEnumCollectors {
2929
* @param valueMapper mapping function used to convert the elements into values
3030
* @param merger function used to handle duplicate values
3131
* @param typeHint array used for enum-type discovery
32+
* @param <T> type of the input elements
3233
* @param <E> type of the enum
34+
* @param <V> type of map values
3335
* @return a collector collecting al its elements into an enum-map
3436
*/
3537
@SafeVarargs
@@ -49,6 +51,7 @@ public class AutoEnumCollectors {
4951
* @param merger function used to handle duplicate values
5052
* @param typeHint array used for enum-type discovery
5153
* @param <E> type of the enum
54+
* @param <V> type of map values
5255
* @return a collector collecting al its elements into an enum-map
5356
*/
5457
@SafeVarargs

java-commons/src/main/java/ru/progrm_jarvis/javacommons/util/stream/EnumCollectors.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ public class EnumCollectors {
3131
/**
3232
* Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}.
3333
*
34-
* @param <E> type of the enum
3534
* @param type type object of the enum
3635
* @param keyMapper mapping function used to convert the elements into enum-keys
3736
* @param valueMapper mapping function used to convert the elements into values
3837
* @param merger function used to handle duplicate values
38+
* @param <T> type of the input elements
39+
* @param <E> type of the enum
40+
* @param <V> type of map values
3941
* @return a collector collecting al its elements into an enum-map
4042
*/
4143
public <T, E extends Enum<E>, V> @NotNull Collector<T, ?, @NotNull Map<E, V>> toEnumMap(
@@ -54,7 +56,9 @@ public class EnumCollectors {
5456
* @param valueMapper mapping function used to convert the elements into values
5557
* @param merger function used to handle duplicate values
5658
* @param typeHint array used for enum-type discovery
59+
* @param <T> type of the input elements
5760
* @param <E> type of the enum
61+
* @param <V> type of map values
5862
* @return a collector collecting al its elements into an enum-map
5963
*/
6064
@SafeVarargs
@@ -70,10 +74,12 @@ public class EnumCollectors {
7074
/**
7175
* Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}.
7276
*
73-
* @param <E> type of the enum
7477
* @param type type object of the enum
7578
* @param keyMapper mapping function used to convert the elements into enum-keys
7679
* @param valueMapper mapping function used to convert the elements into values
80+
* @param <T> type of the input elements
81+
* @param <E> type of the enum
82+
* @param <V> type of map values
7783
* @return a collector collecting al its elements into an enum-map
7884
*/
7985
public <T, E extends Enum<E>, V> @NotNull Collector<T, ?, @NotNull Map<E, V>> toEnumMap(
@@ -87,9 +93,10 @@ public class EnumCollectors {
8793
/**
8894
* Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}.
8995
*
90-
* @param <E> type of the enum
9196
* @param type type object of the enum
9297
* @param valueMapper mapping function used to convert the elements into values
98+
* @param <E> type of the enum
99+
* @param <V> type of map values
93100
* @return a collector collecting al its elements into an enum-map
94101
*/
95102
public <E extends Enum<E>, V> @NotNull Collector<E, ?, @NotNull Map<E, V>> toEnumMap(
@@ -102,10 +109,11 @@ public class EnumCollectors {
102109
/**
103110
* Returns a {@link Collector} that accumulates the input elements into a new enum-{@link Map}.
104111
*
105-
* @param <E> type of the enum
106112
* @param type type object of the enum
107113
* @param valueMapper mapping function used to convert the elements into values
108114
* @param merger function used to handle duplicate values
115+
* @param <E> type of the enum
116+
* @param <V> type of map values
109117
* @return a collector collecting al its elements into an enum-map
110118
*/
111119
public <E extends Enum<E>, V> @NotNull Collector<E, ?, @NotNull Map<E, V>> toEnumMap(
@@ -123,6 +131,7 @@ public class EnumCollectors {
123131
* @param merger function used to handle duplicate values
124132
* @param typeHint array used for enum-type discovery
125133
* @param <E> type of the enum
134+
* @param <V> type of map values
126135
* @return a collector collecting al its elements into an enum-map
127136
*/
128137
@SafeVarargs

0 commit comments

Comments
 (0)