From 273a0e169ac3f0469057876f5545313e740431bc Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 28 Dec 2009 20:39:42 +0000 Subject: [PATCH] * added method to determine whether the @PluginRegistry@ contains a @Plugin@ for the given delimiter git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@8469 5a64d73e-33d6-4ccc-9058-23f8668ecac9 --- .../main/java/org/synyx/hera/core/PluginRegistry.java | 10 ++++++++++ .../org/synyx/hera/core/SimplePluginRegistry.java | 11 +++++++++++ 2 files changed, 21 insertions(+) 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 4208678..73023a7 100644 --- a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java @@ -123,4 +123,14 @@ public interface PluginRegistry, S> extends Iterable { * @return */ boolean contains(T plugin); + + + /** + * Returns whether the registry contains a {@link Plugin} matching the given + * delimiter. + * + * @param delimiter + * @return + */ + boolean hasPluginFor(S delimiter); } \ 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 052b438..fcfd5f0 100644 --- a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java @@ -248,6 +248,17 @@ public class SimplePluginRegistry, S> implements } + /* + * (non-Javadoc) + * + * @see org.synyx.hera.core.PluginRegistry#hasPluginFor(java.lang.Object) + */ + public boolean hasPluginFor(S delimter) { + + return null != getPluginFor(delimter); + } + + /* * (non-Javadoc) *