diff --git a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java index 05e06f1..dd8ad8f 100644 --- a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java @@ -109,4 +109,14 @@ public interface PluginRegistry, S> extends Iterable { * @return */ boolean hasPluginFor(S delimiter); + + + /** + * Returns all {@link Plugin}s contained in this registry. Will return an + * immutable {@link List} to prevent outside modifications of the + * {@link PluginRegistry} content. + * + * @return + */ + List> getPlugins(); } \ No newline at end of file diff --git a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java index 8a91e24..881b3d4 100644 --- a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java @@ -229,14 +229,12 @@ public class SimplePluginRegistry, S> implements * to access all plugins. For distinguished access to certain plugins favour * accessor methods like {link #getPluginFor} over this one. This method * should only be used for testing purposes to check registry configuration. - *

- * TODO: decide whether to make this method public * * @return all plugins of the registry */ - protected List getPlugins() { + public List getPlugins() { - return plugins; + return Collections.unmodifiableList(plugins); }