Skip to content

Commit 7c4a01f

Browse files
authored
Fix: Missing javadocs for pattern matching and other components (#3095)
1 parent 6c4bbe6 commit 7c4a01f

File tree

14 files changed

+1172
-17
lines changed

14 files changed

+1172
-17
lines changed

vavr/generator/Generator.scala

Lines changed: 181 additions & 2 deletions
Large diffs are not rendered by default.

vavr/src-gen/main/java/io/vavr/API.java

Lines changed: 909 additions & 3 deletions
Large diffs are not rendered by default.

vavr/src-gen/main/java/io/vavr/Function1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ default boolean isMemoized() {
235235

236236
/**
237237
* Converts this {@code Function1} to a {@link PartialFunction} by adding an {@code isDefinedAt} condition.
238-
* <p>
238+
*
239239
* @param isDefinedAt a predicate that states if an element is in the domain of the returned {@code PartialFunction}.
240240
* @return a new {@code PartialFunction} that has the same behavior like this function but is defined only for those elements that make it through the given {@code Predicate}
241241
* @throws NullPointerException if {@code isDefinedAt} is null

vavr/src/main/java/io/vavr/Lazy.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
* Example of creating a <em>real</em> lazy value (works only with interfaces):
5252
*
5353
* <pre><code>final CharSequence chars = Lazy.val(() -&gt; "Yay!", CharSequence.class);</code></pre>
54-
*
54+
*
55+
* @param <T> The type of the lazy evaluated value
5556
* @author Daniel Dietrich
5657
*/
5758
// DEV-NOTE: No flatMap and orElse because this more like a Functor than a Monad.

vavr/src/main/java/io/vavr/collection/BitSet.java

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,21 @@
3434
/**
3535
* An immutable {@code BitSet} implementation.
3636
*
37+
* @param <T> Component type
3738
* @author Ruslan Sennov
3839
*/
3940
public interface BitSet<T> extends SortedSet<T> {
4041

42+
/**
43+
* The <a href="https://docs.oracle.com/javase/8/docs/api/index.html">serial version uid</a>.
44+
*/
4145
long serialVersionUID = 1L;
4246

47+
/**
48+
* Builder of the BitSet. Encapsulates the conversion functions for T.
49+
*
50+
* @param <T> Component type
51+
*/
4352
class Builder<T> {
4453

4554
final static Builder<Integer> DEFAULT = new Builder<>(i -> i, i -> i);
@@ -52,6 +61,12 @@ class Builder<T> {
5261
this.toInt = toInt;
5362
}
5463

64+
/**
65+
* Returns a {@link java.util.stream.Collector} which may be used in conjunction with
66+
* {@link java.util.stream.Stream#collect(java.util.stream.Collector)} to obtain an {@link ArrayList}.
67+
*
68+
* @return A {@link ArrayList} Collector.
69+
*/
5570
public Collector<T, ArrayList<T>, BitSet<T>> collector() {
5671
final BinaryOperator<ArrayList<T>> combiner = (left, right) -> {
5772
left.addAll(right);
@@ -60,10 +75,21 @@ public Collector<T, ArrayList<T>, BitSet<T>> collector() {
6075
return Collector.of(ArrayList::new, ArrayList::add, combiner, this::ofAll);
6176
}
6277

78+
/**
79+
* Returns a new empty BitSet
80+
*
81+
* @return new empty BitSet
82+
*/
6383
public BitSet<T> empty() {
6484
return new BitSetModule.BitSet1<>(fromInt, toInt, 0L);
6585
}
6686

87+
/**
88+
* Builds a new BitSet from a specific value t
89+
*
90+
* @param t value to build the BitSet from
91+
* @return new BitSet
92+
*/
6793
public BitSet<T> of(T t) {
6894
final int value = toInt.apply(t);
6995
if (value < BitSetModule.BITS_PER_WORD) {
@@ -75,27 +101,59 @@ public BitSet<T> of(T t) {
75101
}
76102
}
77103

104+
/**
105+
* Builds a new BitSet from a list of values
106+
*
107+
* @param values values to build the BitSet from
108+
* @return new BitSet
109+
*/
78110
@SuppressWarnings("varargs")
79111
@SafeVarargs
80112
public final BitSet<T> of(T... values) {
81113
return empty().addAll(Array.wrap(values));
82114
}
83115

116+
/**
117+
* Builds a new BitSet from an {@link Iterable}
118+
*
119+
* @param values iterable to build the BitSet from
120+
* @return new BitSet
121+
*/
84122
public BitSet<T> ofAll(Iterable<? extends T> values) {
85123
Objects.requireNonNull(values, "values is null");
86124
return empty().addAll(values);
87125
}
88126

127+
/**
128+
* Builds a new BitSet from a {@link java.util.stream.Stream} of values
129+
*
130+
* @param javaStream stream of values to build the BitSet from
131+
* @return new BitSet
132+
*/
89133
public BitSet<T> ofAll(java.util.stream.Stream<? extends T> javaStream) {
90134
Objects.requireNonNull(javaStream, "javaStream is null");
91135
return empty().addAll(Iterator.ofAll(javaStream.iterator()));
92136
}
93137

138+
/**
139+
* Builds a new BitSet tabulating a value n times
140+
*
141+
* @param n number of times to tabulate
142+
* @param f function to tabulate
143+
* @return new BitSet
144+
*/
94145
public BitSet<T> tabulate(int n, Function<? super Integer, ? extends T> f) {
95146
Objects.requireNonNull(f, "f is null");
96147
return empty().addAll(Collections.tabulate(n, f));
97148
}
98149

150+
/**
151+
* Builds a new BitSet containing n copies of the same value
152+
*
153+
* @param n number of times to copy the value
154+
* @param s value supplier
155+
* @return new BitSet
156+
*/
99157
public BitSet<T> fill(int n, Supplier<? extends T> s) {
100158
Objects.requireNonNull(s, "s is null");
101159
return empty().addAll(Collections.fill(n, s));
@@ -115,14 +173,29 @@ static Builder<Character> withCharacters() {
115173
return new Builder<>(i -> (char) i.intValue(), c -> (int) c);
116174
}
117175

176+
/**
177+
* Returns new {@link BitSet} Builder for type {@link Byte}
178+
*
179+
* @return new Builder
180+
*/
118181
static Builder<Byte> withBytes() {
119182
return new Builder<>(Integer::byteValue, Byte::intValue);
120183
}
121184

185+
/**
186+
* Returns new {@link BitSet} Builder for type {@link Long}
187+
*
188+
* @return new Builder
189+
*/
122190
static Builder<Long> withLongs() {
123191
return new Builder<>(Integer::longValue, Long::intValue);
124192
}
125193

194+
/**
195+
* Returns new {@link BitSet} Builder for type {@link Short}
196+
*
197+
* @return new Builder
198+
*/
126199
static Builder<Short> withShorts() {
127200
return new Builder<>(Integer::shortValue, Short::intValue);
128201
}

vavr/src/main/java/io/vavr/collection/CharSeq.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,6 @@ public CharSeq toLowerCase(Locale locale) {
25412541
* LATIN SMALL LETTER DOTLESS I character.
25422542
* To obtain correct results for locale insensitive strings, use
25432543
* {@code toLowerCase(Locale.ROOT)}.
2544-
* <p>
25452544
*
25462545
* @return the {@code CharSeq}, converted to lowercase.
25472546
* @see String#toLowerCase(Locale)
@@ -2618,7 +2617,6 @@ public CharSeq toUpperCase(Locale locale) {
26182617
* LATIN CAPITAL LETTER I WITH DOT ABOVE character.
26192618
* To obtain correct results for locale insensitive strings, use
26202619
* {@code toUpperCase(Locale.ROOT)}.
2621-
* <p>
26222620
*
26232621
* @return the {@code CharSeq}, converted to uppercase.
26242622
* @see String#toUpperCase(Locale)
@@ -2697,7 +2695,6 @@ public CharSeq capitalize(Locale locale) {
26972695
* LATIN CAPITAL LETTER I WITH DOT ABOVE character.
26982696
* To obtain correct results for locale insensitive strings, use
26992697
* {@code toUpperCase(Locale.ROOT)}.
2700-
* <p>
27012698
*
27022699
* @return the {@code CharSeq}, capitalized.
27032700
*/

vavr/src/main/java/io/vavr/collection/HashMap.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* An immutable {@code HashMap} implementation based on a
3434
* <a href="https://en.wikipedia.org/wiki/Hash_array_mapped_trie">Hash array mapped trie (HAMT)</a>.
3535
*
36+
* @param <K> Key type
37+
* @param <V> Value type
3638
* @author Ruslan Sennov, Patryk Najda, Daniel Dietrich
3739
*/
3840
public final class HashMap<K, V> implements Map<K, V>, Serializable {

vavr/src/main/java/io/vavr/collection/LinkedHashMap.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
/**
3232
* An immutable {@code LinkedHashMap} implementation that has predictable (insertion-order) iteration.
3333
*
34+
* @param <K> Key type
35+
* @param <V> Value type
3436
* @author Ruslan Sennov
3537
*/
3638
public final class LinkedHashMap<K, V> implements Map<K, V>, Serializable {

vavr/src/main/java/io/vavr/collection/PriorityQueue.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/**
3131
* A PriorityQueue.
3232
*
33+
* @param <T> Component type
3334
* @author Pap Lőrinc
3435
*/
3536
public final class PriorityQueue<T> extends io.vavr.collection.AbstractQueue<T, PriorityQueue<T>> implements Serializable, Ordered<T> {

vavr/src/main/java/io/vavr/concurrent/Task.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface Task<T> {
3131

3232
/**
3333
* Completes a task.
34-
* <p>
34+
*
3535
* @param <T> result type
3636
*/
3737
@FunctionalInterface

0 commit comments

Comments
 (0)