/** * Indicates whether the given build plugin is registered, based on its * groupId, artifactId, and version. * * @param plugin to check (required) * @return whether the build plugin is currently registered or not * @deprecated use {@link #isPluginRegistered(GAV)} instead */ @Deprecated public boolean isBuildPluginRegistered(final Plugin plugin) { return plugin != null && isPluginRegistered(plugin.getGAV()); }
/** * Indicates whether a plugin with the given coordinates is registered * * @param coordinates the coordinates to match upon; can be * <code>null</code> * @return false if <code>null</code> coordinates are given */ public boolean isPluginRegistered(final GAV gav) { for (final Plugin existingPlugin : buildPlugins) { if (existingPlugin.getGAV().equals(gav)) { return true; } } return false; }
public int compareTo(final Plugin o) { if (o == null) { throw new NullPointerException(); } int result = gav.compareTo(o.getGAV()); if (result == 0 && configuration != null && o.configuration != null) { result = configuration.compareTo(o.configuration); } return result; }