You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "joerghoh (via GitHub)" <gi...@apache.org> on 2023/03/04 16:43:05 UTC

[GitHub] [sling-org-apache-sling-resourcecollection] joerghoh commented on a diff in pull request #3: SLING-11794 - Adding a new method to get the properties as an adapted type

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


##########
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:
   You can provide as type also a SlingModel class. Is this something we want to support?



-- 
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: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org