Record Class GAVR
The GroupID, ArtifactID & Version are mandatory and cannot be empty. The Extension, Classifier & Repository can be empty (but never null).
The Maven default extension "jar" are hidden in the GAV coordinates and Package URL syntax
(but is returned by extension() API). This is different from Maven core, which always
shows "jar".
This class itself does NOT imply any other "defaults" for Classifier & Repository. Callers
of this class may resolve a GAVR without repo to one with a repo using Mima.origin(ModelResponse).
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theartifactIdrecord component.Returns the value of theclassifierrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionrecord component.groupId()Returns the value of thegroupIdrecord component.final inthashCode()Returns a hash code value for this object.static GAVRParse a coordinates in the<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>format, like e.g.static GAVRparsePkgURL(String purl) Parse a Maven Package URL.repo()Returns the value of thereporecord component.toGAV()Return a String in the same format thatparseGAV(String)uses.toPkgURL()Return a String in the same format thatparsePkgURL(String)uses.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
GAVR
public GAVR(String groupId, String artifactId, String extension, String classifier, String version, String repo) Creates an instance of aGAVRrecord class.- Parameters:
groupId- the value for thegroupIdrecord componentartifactId- the value for theartifactIdrecord componentextension- the value for theextensionrecord componentclassifier- the value for theclassifierrecord componentversion- the value for theversionrecord componentrepo- the value for thereporecord component
-
-
Method Details
-
parseGAV
Parse a coordinates in the<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>format, like e.g. "ch.vorburger.mariaDB4j:mariaDB4j-core:3.1.0" to a GAVR.This format is not a URL; use
parsePkgURL(String)if you have a URL, ortoPkgURL()if you want one.PS: This syntax does not allow specifying a repository!
-
toPkgURL
Return a String in the same format thatparsePkgURL(String)uses. -
parsePkgURL
Parse a Maven Package URL. For example, "pkg:maven/ch.vorburger.mariaDB4j/mariaDB4j-core@3.1.0?classifier=javadoc". See Type definition and its underlying SPDX specification. -
toGAV
Return a String in the same format thatparseGAV(String)uses.This omits extension "jar" when it can (contrary to how org.eclipse.aether.artifact.AbstractArtifact#toString() does it).
-
toBuilder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
groupId
Returns the value of thegroupIdrecord component.- Returns:
- the value of the
groupIdrecord component
-
artifactId
Returns the value of theartifactIdrecord component.- Returns:
- the value of the
artifactIdrecord component
-
extension
Returns the value of theextensionrecord component.- Returns:
- the value of the
extensionrecord component
-
classifier
Returns the value of theclassifierrecord component.- Returns:
- the value of the
classifierrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
repo
Returns the value of thereporecord component.- Returns:
- the value of the
reporecord component
-