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


##########
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:
   @joerghoh yeah, I debated making it more specific (e.g. get the `ValueMap` 
or `Resource`) but decided allowing any adaptable target class would both make 
the code cleaner and be more generic. 



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