+ /**
+ * Check if a given {@link SourceIdentifier} satisfies the needs of this dependency.
+ *
+ * @param sourceId given {@link SourceIdentifier}
+ * @return {@code true} if the {@link SourceIdentifier} satisfies this dependency
+ * @throws NullPointerException if {@code sourceId} is {@code null}
+ */
+ default boolean isSatisfiedBy(final SourceIdentifier sourceId) {
+ if (name().equals(sourceId.name())) {
+ final var revision = revision();
+ if (revision == null || revision.equals(sourceId.revision())) {
+ return true;
+ }
+ }
+ return false;
+ }
+