@Override public String toString() { return (this.isAssembled() ? "Assembled Feature" : "Feature") + " [id=" + this.getId().toMvnId() + ( this.getLocation() != null ? ", location=" + this.getLocation() : "") + "]"; }
/** * Remove the exact artifact. The first one found is removed. * * @param id The artifact id * @return {@code true} if the artifact has been removed */ public boolean removeExact(final ArtifactId id) { for (final Artifact artifact : this) { if ( artifact.getId().equals(id)) { return this.remove(artifact); } } return false; }
/** * 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; } }
/** * Create a copy of the Extension * @return A copy of the Extension */ public Extension copy() { Extension c = new Extension(type, name, required); switch(type) { case TEXT: c.setText(text); break; case JSON: c.setJSON(text); break; case ARTIFACTS: if (artifacts != null) { for (Artifact a : artifacts) { c.getArtifacts().add(a.copy(a.getId())); } } break; } return c; }
/** * 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; }
/** * Add an artifact. If the exact artifact is already contained in the * collection, it is not added again. * * @param artifact The artifact * @return {@code true} if this collection changed as a result of the call */ @Override public boolean add(final Artifact artifact) { if (this.containsExact(artifact.getId())) { return false; } return super.add(artifact); }
@Override public Artifact getArtifact() { return new Artifact(framework); }
@Override public String toString() { return "Include [id=" + id.toMvnId() + "]"; } }
/** * Return whether the extension is required or optional * @return Return {@code true} if the extension is optional. */ public boolean isOptional() { return !this.isRequired(); }
@Override public int compareTo(final Artifact o) { return this.id.compareTo(o.id); }
@Override public int hashCode() { return this.id.hashCode(); }
/** * 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; }
@Override public String toString() { return "Artifact [id=" + id.toMvnId() + "]"; } }
@Override public int compareTo(final Prototype o) { return this.id.compareTo(o.id); }
@Override public int hashCode() { return this.id.hashCode(); }
@Override public String toString() { return toMvnId(); }
@Override public int compareTo(final Feature o) { return this.id.compareTo(o.id); }
@Override public int hashCode() { return this.id.hashCode(); }