Skip to content

Commit 56b2285

Browse files
committed
remove api notes
1 parent f3e777d commit 56b2285

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

src/main/java/io/jbock/util/LeftOptional.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ private LeftOptional(Optional<T> value) {
3232
* Returns an empty {@code LeftOptional} instance. No value is present for this
3333
* {@code LeftOptional}.
3434
*
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-
*
4135
* @param <T> The type of the non-existent value
4236
* @return an empty {@code LeftOptional}
4337
*/
@@ -90,9 +84,6 @@ public static <T> LeftOptional<T> ofNullable(T value) {
9084
* If a value is present, returns the value, otherwise throws
9185
* {@code NoSuchElementException}.
9286
*
93-
* @apiNote
94-
* The preferred alternative to this method is {@link #orElseThrow()}.
95-
*
9687
* @return the non-{@code null} value described by this {@code LeftOptional}
9788
* @throws NoSuchElementException if no value is present
9889
*/
@@ -169,24 +160,6 @@ public LeftOptional<T> filter(Predicate<? super T> predicate) {
169160
* <p>If the mapping function returns a {@code null} result then this method
170161
* returns an empty {@code LeftOptional}.
171162
*
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-
*
190163
* @param mapper the mapping function to apply to a value, if present
191164
* @param <U> The type of the value returned from the mapping function
192165
* @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
251224
* If a value is present, returns a sequential {@link Stream} containing
252225
* only that value, otherwise returns an empty {@code Stream}.
253226
*
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-
*
262227
* @return the optional value as a {@code Stream}
263228
*/
264229
public Stream<T> stream() {
@@ -306,11 +271,6 @@ public T orElseThrow() {
306271
* If a value is present, returns the value, otherwise throws an exception
307272
* produced by the exception supplying function.
308273
*
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-
*
314274
* @param <X> Type of the exception to be thrown
315275
* @param exceptionSupplier the supplying function that produces an
316276
* exception to be thrown
@@ -401,11 +361,6 @@ public int hashCode() {
401361
* suitable for debugging. The exact presentation format is unspecified and
402362
* may vary between implementations and versions.
403363
*
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-
*
409364
* @return the string representation of this instance
410365
*/
411366
@Override

0 commit comments

Comments
 (0)