You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/07/31 12:32:34 UTC

[isis] branch master updated: ISIS-2340: Can: just java-doc

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new cee32c1  ISIS-2340: Can: just java-doc
cee32c1 is described below

commit cee32c116a65a07b07462f4b76cfc2337a5d1b2e
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jul 31 14:32:15 2020 +0200

    ISIS-2340: Can: just java-doc
---
 .../main/java/org/apache/isis/core/commons/collections/Can.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/core/commons/src/main/java/org/apache/isis/core/commons/collections/Can.java b/core/commons/src/main/java/org/apache/isis/core/commons/collections/Can.java
index 7b5d8b5..13388ad 100644
--- a/core/commons/src/main/java/org/apache/isis/core/commons/collections/Can.java
+++ b/core/commons/src/main/java/org/apache/isis/core/commons/collections/Can.java
@@ -76,16 +76,20 @@ public interface Can<T> extends Iterable<T>, Serializable {
     int size();
     
     /**
+     * Will only ever return an empty Optional, if the elementIndex is out of bounds.
      * @param elementIndex
-     * @return optionally this Can's element with index {@code elementIndex} 
+     * @return optionally this Can's element with index {@code elementIndex}, 
+     * based on whether this index is within bounds 
      */
     Optional<T> get(int elementIndex);
     
     /**
      * Shortcut to {@code get(elementIndex).orElseThrow(...)}
+     * <p>
+     * Will only ever throw, if the elementIndex is out of bounds.
      * @param elementIndex
      * @return this Can's element with index {@code elementIndex}
-     * @throws NoSuchElementException
+     * @throws NoSuchElementException when the elementIndex is out of bounds
      * @see {@link #get(int)} 
      */
     default T getElseFail(final int elementIndex) {