klcodanr commented on code in PR #3:
URL: 
https://github.com/apache/sling-org-apache-sling-resourcecollection/pull/3#discussion_r1126724006


##########
src/main/java/org/apache/sling/resource/collection/ResourceCollection.java:
##########
@@ -67,7 +68,16 @@ public interface ResourceCollection {
     /**
      * Returns additional properties for a particular resource in Collection 
entry.
      *
-     * @return properties of the Collection entry as 
<code>ModifiableValueMap</code>, returns null if entry found.
+     * @return properties of the Collection entry as the specified type, 
returns empty if no entry found or 
+     *  the entry cannot be adapted to the type
+     */
+    <T> Optional<T> getPropertiesAs(Resource resource, Class<T> type);

Review Comment:
   Good point, especially in light of this class not functionally changing in a 
decade. I reverted to just returning the ValueMap and ensuring that the 
ValueMap will never be null (though it may be empty if the resource is not 
found in the collection or the adaption fails) 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to