@@ -32,12 +32,6 @@ private LeftOptional(Optional<T> value) {
32
32
* Returns an empty {@code LeftOptional} instance. No value is present for this
33
33
* {@code LeftOptional}.
34
34
*
35
- * @apiNote
36
- * Though it may be tempting to do so, avoid testing if an object is empty
37
- * by comparing with {@code ==} or {@code !=} against instances returned by
38
- * {@code Optional.empty()}. There is no guarantee that it is a singleton.
39
- * Instead, use {@link #isEmpty()} or {@link #isPresent()}.
40
- *
41
35
* @param <T> The type of the non-existent value
42
36
* @return an empty {@code LeftOptional}
43
37
*/
@@ -90,9 +84,6 @@ public static <T> LeftOptional<T> ofNullable(T value) {
90
84
* If a value is present, returns the value, otherwise throws
91
85
* {@code NoSuchElementException}.
92
86
*
93
- * @apiNote
94
- * The preferred alternative to this method is {@link #orElseThrow()}.
95
- *
96
87
* @return the non-{@code null} value described by this {@code LeftOptional}
97
88
* @throws NoSuchElementException if no value is present
98
89
*/
@@ -169,24 +160,6 @@ public LeftOptional<T> filter(Predicate<? super T> predicate) {
169
160
* <p>If the mapping function returns a {@code null} result then this method
170
161
* returns an empty {@code LeftOptional}.
171
162
*
172
- * @apiNote
173
- * This method supports post-processing on {@code LeftOptional} values, without
174
- * the need to explicitly check for a return status. For example, the
175
- * following code traverses a stream of URIs, selects one that has not
176
- * yet been processed, and creates a path from that URI, returning
177
- * an {@code Optional<Path>}:
178
- *
179
- * <pre>{@code
180
- * Optional<Path> p =
181
- * uris.stream().filter(uri -> !isProcessedYet(uri))
182
- * .findFirst()
183
- * .map(Paths::get);
184
- * }</pre>
185
- *
186
- * Here, {@code findFirst} returns an {@code Optional<URI>}, and then
187
- * {@code map} returns an {@code Optional<Path>} for the desired
188
- * URI if one exists.
189
- *
190
163
* @param mapper the mapping function to apply to a value, if present
191
164
* @param <U> The type of the value returned from the mapping function
192
165
* @return a {@code LeftOptional} describing the result of applying a mapping
@@ -251,14 +224,6 @@ public LeftOptional<T> or(Supplier<? extends LeftOptional<? extends T>> supplier
251
224
* If a value is present, returns a sequential {@link Stream} containing
252
225
* only that value, otherwise returns an empty {@code Stream}.
253
226
*
254
- * @apiNote
255
- * This method can be used to transform a {@code Stream} of optional
256
- * elements to a {@code Stream} of present value elements:
257
- * <pre>{@code
258
- * Stream<Optional<T>> os = ..
259
- * Stream<T> s = os.flatMap(Optional::stream)
260
- * }</pre>
261
- *
262
227
* @return the optional value as a {@code Stream}
263
228
*/
264
229
public Stream <T > stream () {
@@ -306,11 +271,6 @@ public T orElseThrow() {
306
271
* If a value is present, returns the value, otherwise throws an exception
307
272
* produced by the exception supplying function.
308
273
*
309
- * @apiNote
310
- * A method reference to the exception constructor with an empty argument
311
- * list can be used as the supplier. For example,
312
- * {@code IllegalStateException::new}
313
- *
314
274
* @param <X> Type of the exception to be thrown
315
275
* @param exceptionSupplier the supplying function that produces an
316
276
* exception to be thrown
@@ -401,11 +361,6 @@ public int hashCode() {
401
361
* suitable for debugging. The exact presentation format is unspecified and
402
362
* may vary between implementations and versions.
403
363
*
404
- * @implSpec
405
- * If a value is present the result must include its string representation
406
- * in the result. Empty and present {@code LeftOptional}s must be unambiguously
407
- * differentiable.
408
- *
409
364
* @return the string representation of this instance
410
365
*/
411
366
@ Override
0 commit comments