java.lang.Object
de.sormuras.bach.project.Link
- All Implemented Interfaces:
Comparable<Link>
public final class Link extends Object implements Comparable<Link>
A link is module-uri pair used to resolve external modules.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description intcompareTo(Link other)booleanequals(Object object)Map<String,String>findDigests()List<String>findFragments(String key)Optional<Integer>findSize()Optional<String>findVersion()inthashCode()Stringmodule()static LinkofCentral(String module, String gav)Create a new module link pointing to an artifact hosted at Maven Central.static LinkofCentral(String module, String group, String artifact, String version)Create a new module link pointing to an artifact hosted at Maven Central.static LinkofJitPack(String module, String user, String repository, String version)Create a new module link pointing to an artifact built by JitPack.static LinkofJUnitJupiter(String suffix, String version)Create a new link pointing to a modular JUnit Jupiter JAR file hosted at Maven Central.static LinkofJUnitPlatform(String suffix, String version)Create a new link pointing to a modular JUnit Platform JAR file hosted at Maven Central.StringtoModularJarFileName()URItoURI()Stringuri()LinkwithDigest(String algorithm, String digest)LinkwithSize(long size)LinkwithVersion(String version)
-
Constructor Details
-
Method Details
-
ofCentral
Create a new module link pointing to an artifact hosted at Maven Central.- Parameters:
module- The module to used as the nominal part of the pairgroup- Maven Group IDartifact- Maven Artifact IDversion- The version string- Returns:
- A new Maven Central-based
Linkinstance - See Also:
- search.maven.org
-
ofCentral
Create a new module link pointing to an artifact hosted at Maven Central.- Parameters:
module- The module to used as the nominal part of the pairgav- Maven groupId + ':' + artifactId + ':' version [+ ':' + classifier]- Returns:
- A new Maven Central-based
Linkinstance - See Also:
- search.maven.org
-
ofJitPack
Create a new module link pointing to an artifact built by JitPack.- Parameters:
module- The module to used as the nominal part of the pairuser- GitHub username or the complete group like"com.azure.${USER}"repository- Name of the repository or projectversion- The version string of the repository or project, which is either a release tag, a commit hash, or"${BRANCH}-SNAPSHOT"for a version that has not been released.- Returns:
- A new JitPack-based
Linkinstance - See Also:
- jitpack.io
-
ofJUnitJupiter
Create a new link pointing to a modular JUnit Jupiter JAR file hosted at Maven Central.- Parameters:
suffix- The suffix used to complete the module name and the Maven Artifact IDversion- The version string- Returns:
- A new Maven Central-based
Linkinstance of JUnit Jupiter - See Also:
- org.junit.platform[.]$suffix
-
ofJUnitPlatform
Create a new link pointing to a modular JUnit Platform JAR file hosted at Maven Central.- Parameters:
suffix- The suffix used to complete the module name and the Maven Artifact IDversion- The version string- Returns:
- A new Maven Central-based
Linkinstance of JUnit Platform - See Also:
- org.junit.platform.$suffix
-
module
-
uri
-
compareTo
- Specified by:
compareToin interfaceComparable<Link>
-
equals
-
hashCode
public int hashCode() -
findFragments
-
findDigests
-
findSize
-
findVersion
-
toURI
-
toModularJarFileName
-
withDigest
-
withSize
-
withVersion
-