Interface SourceDependency

All Superinterfaces:
Serializable
All Known Implementing Classes:
SourceDependency.BelongsTo, SourceDependency.Import, SourceDependency.Include

@NonNullByDefault public sealed interface SourceDependency extends Serializable permits SourceDependency.Import, SourceDependency.Include, SourceDependency.BelongsTo
Common interface expressing a dependency on a source, be it a ModuleStatement or a SubmoduleStatement.
  • Method Details

    • name

      The name of the required source.
      Returns:
      name of the required source
    • revision

      @Nullable Revision revision()
      Returns required source revision. If specified, this dependency can be satisfied only by the specified revision or its semantic equivalent (think semantic version of imports). If unspecified, this dependency can be satisfied by any source with a matching name().

      Satisfaction criteria can be easily be valuated via isSatisfiedBy(SourceIdentifier).

      Returns:
      required source revision, null if unspecified
    • isSatisfiedBy

      default boolean isSatisfiedBy(SourceIdentifier sourceId)
      Check if a given SourceIdentifier satisfies the needs of this dependency.
      Parameters:
      sourceId - given SourceIdentifier
      Returns:
      true if the SourceIdentifier satisfies this dependency
      Throws:
      NullPointerException - if sourceId is null