Class ArtifactCoordinates


  • public final class ArtifactCoordinates
    extends java.lang.Object
    Maven artifact coordinate specification.
    Author:
    David M. Lloyd
    • Constructor Summary

      Constructors 
      Constructor Description
      ArtifactCoordinates​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
      Construct a new instance with an empty classifier.
      ArtifactCoordinates​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String classifier)
      Construct a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Determine whether this coordinates object equals the target object.
      boolean equals​(ArtifactCoordinates obj)
      Determine whether this coordinates object equals the target object.
      static ArtifactCoordinates fromString​(java.lang.String string)
      Parse a string and produce artifact coordinates from it.
      java.lang.String getArtifactId()
      Get the artifact ID.
      java.lang.String getClassifier()
      Get the classifier.
      java.lang.String getGroupId()
      Get the group ID.
      java.lang.String getVersion()
      Get the version.
      int hashCode()
      Get the hash code.
      java.lang.String relativeArtifactPath()
      Create a relative repository path for the given artifact coordinates with a '/' separator.
      java.lang.String relativeArtifactPath​(char separator)
      Create a relative repository path for the given artifact coordinates.
      java.lang.String toString()
      Get the string representation.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ArtifactCoordinates

        public ArtifactCoordinates​(java.lang.String groupId,
                                   java.lang.String artifactId,
                                   java.lang.String version,
                                   java.lang.String classifier)
        Construct a new instance.
        Parameters:
        groupId - the group ID (must not be null)
        artifactId - the artifact ID (must not be null)
        version - the version string (must not be null)
        classifier - the classifier string (must not be null, may be empty)
      • ArtifactCoordinates

        public ArtifactCoordinates​(java.lang.String groupId,
                                   java.lang.String artifactId,
                                   java.lang.String version)
        Construct a new instance with an empty classifier.
        Parameters:
        groupId - the group ID (must not be null)
        artifactId - the artifact ID (must not be null)
        version - the version string (must not be null)
    • Method Detail

      • fromString

        public static ArtifactCoordinates fromString​(java.lang.String string)
        Parse a string and produce artifact coordinates from it.
        Parameters:
        string - the string to parse (must not be null)
        Returns:
        the artifact coordinates object (not null)
      • getGroupId

        public java.lang.String getGroupId()
        Get the group ID.
        Returns:
        the group ID (not null)
      • getArtifactId

        public java.lang.String getArtifactId()
        Get the artifact ID.
        Returns:
        the artifact ID (not null)
      • getVersion

        public java.lang.String getVersion()
        Get the version.
        Returns:
        the version (not null)
      • getClassifier

        public java.lang.String getClassifier()
        Get the classifier.
        Returns:
        the classifier (not null, may be empty)
      • relativeArtifactPath

        public java.lang.String relativeArtifactPath​(char separator)
        Create a relative repository path for the given artifact coordinates.
        Parameters:
        separator - the separator character to use (typically '/' or File.separatorChar)
        Returns:
        the path string
      • relativeArtifactPath

        public java.lang.String relativeArtifactPath()
        Create a relative repository path for the given artifact coordinates with a '/' separator.
        Returns:
        the path string
      • equals

        public boolean equals​(java.lang.Object obj)
        Determine whether this coordinates object equals the target object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the target object
        Returns:
        true if the object is equal to this one, false otherwise
      • equals

        public boolean equals​(ArtifactCoordinates obj)
        Determine whether this coordinates object equals the target object.
        Parameters:
        obj - the target object
        Returns:
        true if the object is equal to this one, false otherwise
      • hashCode

        public int hashCode()
        Get the hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation