slawekjaranowski commented on code in PR #152: URL: https://github.com/apache/maven-enforcer/pull/152#discussion_r884274320
########## enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java: ########## @@ -131,4 +132,13 @@ List<?> getComponentList ( String role ) * @return the container */ PlexusContainer getContainer(); + + /** + * Gets a cached value, or uses the provided producer to compute it. + * + * @param key a key to identify the value stored + * @param producer a supplier for the value if it's not already present + * @return a previously-cached or freshly-computed value + */ + Object getCache( String key, Supplier<?> producer ); Review Comment: What do you think about use generic here?, eg ``` <T> T getCache( String key, Supplier<T> producer ); ``` of course we have cast in method implementation, but it will be in one place, not in every place where method will be used. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org