You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/10/30 09:04:22 UTC

[GitHub] [sling-org-apache-sling-api] cziegeler commented on a change in pull request #39: SLING-10895 add getPropertyMap() method

cziegeler commented on a change in pull request #39:
URL: https://github.com/apache/sling-org-apache-sling-api/pull/39#discussion_r739629027



##########
File path: src/main/java/org/apache/sling/api/resource/ResourceResolver.java
##########
@@ -842,4 +842,20 @@ Resource copy(final String srcAbsPath,
      */
     Resource move(final String srcAbsPath,
               final String destAbsPath) throws PersistenceException;
+
+    /**
+     * Returns a map to store temporary objects.
+     *
+     * This map is suited to store objects which share the same lifecycle as the
+     * resource resolver. The resource resolver itself does not use this map.
+     *
+     * The resource resolver will clear the map during {@link #close()}, so afterwards the map is empty.
+     * If a stored value implements the {@link #Closeable} interface, the ResourceResolver will invoke the
+     * <code>close()</code> of the value before clearing the map.
+     *
+     * @returns the property map
+     * @since 2.13.0
+     *
+     */
+    public @NotNull Map<String,Object> getPropertyMap();

Review comment:
       I don't think that the use case is restricted to caching. The best name would probably getAttributesMap but we have read-only attributes already. For me, properties sounds good




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