diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-01 23:15:47 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2019-04-01 23:15:47 +0300 |
commit | 08dc162b426865e0555c34b59e54f8d6c28a61bc (patch) | |
tree | a0460848b2fc0e8d194673ef7e44691e6382d6b4 /pf4j | |
parent | 9ae845b56d686ea4d4d6db4faa9d0231bfd318a6 (diff) | |
download | pf4j-08dc162b426865e0555c34b59e54f8d6c28a61bc.tar.gz pf4j-08dc162b426865e0555c34b59e54f8d6c28a61bc.zip |
Resolve TODO (add isDevelopment method as default method in PluginManager)
Diffstat (limited to 'pf4j')
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractPluginManager.java | 5 | ||||
-rw-r--r-- | pf4j/src/main/java/org/pf4j/PluginManager.java | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index ba12eef..5803a62 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -913,11 +913,6 @@ public abstract class AbstractPluginManager implements PluginManager { } } - // TODO add this method in PluginManager as default method for Java 8. - protected boolean isDevelopment() { - return RuntimeMode.DEVELOPMENT.equals(getRuntimeMode()); - } - /** * @return true if exact versions in requires is allowed */ diff --git a/pf4j/src/main/java/org/pf4j/PluginManager.java b/pf4j/src/main/java/org/pf4j/PluginManager.java index c2cbacc..11d3eac 100644 --- a/pf4j/src/main/java/org/pf4j/PluginManager.java +++ b/pf4j/src/main/java/org/pf4j/PluginManager.java @@ -155,6 +155,13 @@ public interface PluginManager { RuntimeMode getRuntimeMode(); /** + * Returns {@code true} id the runtime mode is {@code RuntimeMode.DEVELOPMENT}. + */ + default boolean isDevelopment() { + return RuntimeMode.DEVELOPMENT.equals(getRuntimeMode()); + } + + /** * Retrieves the {@link PluginWrapper} that loaded the given class 'clazz'. */ PluginWrapper whichPlugin(Class<?> clazz); |