ajs6f commented on a change in pull request #571: JENA-1714: Migrate 'migrate' 
packages
URL: https://github.com/apache/jena/pull/571#discussion_r288198140
 
 

 ##########
 File path: jena-base/src/main/java/org/apache/jena/atlas/lib/StreamOps.java
 ##########
 @@ -34,25 +39,32 @@
         return Iter.asStream(iter);
     }
 
+    /** Stream to {@link List} */
     public static <X> List<X> toList(Stream<X> stream) {
         return stream.collect(Collectors.toList());
     }
 
+    /** Stream to {@link Set} */
     public static <X> Set<X> toSet(Stream<X> stream) {
         return stream.collect(Collectors.toSet());
     }
 
+    /** First element or null */
     public static <X> X first(Stream<X> stream) {
         return stream.findFirst().orElse(null);
     }
 
+    /** An element from a {@link Collection} */ 
     public static <X> X element(Collection<X> collection) {
         return first(collection.stream());
     }
 
+    /** Debug : print stream.
+     * This operation prints the whole stream at the point it is used, 
+     * and then returns a new stream of the same elements.
+     */ 
     public static <X> Stream<X> print(Stream<X> stream) {
         stream = stream.map(item -> { System.out.println(item); return item; 
});
 
 Review comment:
   Oops-- just realized this isn't part of the PR, sorry!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to