/** * Checks whether the same artifact is available, neglecting the version * @param id The artifact id. * @return {@code true} if the artifact exists */ public boolean containsSame(final ArtifactId id) { for (final Artifact entry : this) { if ( entry.getId().isSame(id)) { return true; } } return false; } }
/** * Get the artifact for the given id, neglecting the version * * @param id The artifact id * @return The artifact or {@code null} otherwise */ public Artifact getSame(final ArtifactId id) { for (final Artifact artifact : this) { if (artifact.getId().isSame(id)) { return artifact; } } return null; }
/** * Remove the same artifact, neglecting the version. The first one found is * removed. * * @param id The artifact id * @return {@code true} if the artifact has been removed */ public boolean removeSame(final ArtifactId id) { for (final Artifact artifact : this) { if ( artifact.getId().isSame(id)) { return this.remove(artifact); } } return false; }
Feature found = null; for(final Feature s : featureList) { if ( s.getId().isSame(f.getId()) ) { found = s; break;