Class ManifestIdentifier

  • Direct Known Subclasses:
    ArtifactIdentifier

    public class ManifestIdentifier
    extends java.lang.Object
    Describes an Manifest identifier, a case-insensitive identification scheme for ArtifactManifests. Format: packageId:artifactId Example: com.github.manevolent:ts3j ManifestIdentifier has a method (fromString) which allows you to parse well-formatted manifest qualifiers. Manifest identifiers have two levels of identification: - packageId, a global-scope specifier which isolates Artifacts to specific packages. - artifactId, a package-scope specifier which identifies a particular artifact within a package. Manifest identifiers are case-insensitive by nature, and all overloaded Object method adhere to this specification. Due to this, it is safe to use separate but logically equal instances of ManifestIdentifier in a Map, or dictionary, utilizing hashed keys.
    • Constructor Summary

      Constructors 
      Constructor Description
      ManifestIdentifier​(java.lang.String packageId, java.lang.String artifactId)
      Constructs a new artifact identifier.
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(ManifestIdentifier b)
      Checks for equality between two ArtifactIdentifiers.
      boolean equals​(java.lang.Object b)  
      static ManifestIdentifier fromString​(java.lang.String string)
      Parses the specified string and converts it into a well-formatted Artifact identifier.
      java.lang.String getArtifactId()
      Gets the artifactId associated with this artifact identifier.
      java.lang.String getPackageId()
      Gets the packageId associated with this artifact identifier.
      int hashCode()  
      java.lang.String toString()
      Converts this artifact identifier to a string.
      ArtifactIdentifier withVersion​(java.lang.String version)
      Constructs an anonymized ArtifactIdentifier instance, without the version component.
      • Methods inherited from class java.lang.Object

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

      • ManifestIdentifier

        public ManifestIdentifier​(java.lang.String packageId,
                                  java.lang.String artifactId)
        Constructs a new artifact identifier.
        Parameters:
        packageId - Package ID of the artifact, must not be null.
        artifactId - Artifact ID of the artifact, must not be null.
    • Method Detail

      • getArtifactId

        public final java.lang.String getArtifactId()
        Gets the artifactId associated with this artifact identifier.
        Returns:
        artifactId.
      • getPackageId

        public final java.lang.String getPackageId()
        Gets the packageId associated with this artifact identifier.
        Returns:
        packageId.
      • toString

        public java.lang.String toString()
        Converts this artifact identifier to a string. There are two possible formats, depending on the value of version (getVersion()): Version is null: packageId:artifactId Version is not null: packageId:artifactId:version
        Overrides:
        toString in class java.lang.Object
        Returns:
        the ArtifactIdentifier's string representation.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object b)
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(ManifestIdentifier b)
        Checks for equality between two ArtifactIdentifiers. When comparing versions, two ArtifactIdentifiers each with a null version are considered equal.
        Parameters:
        b - artifact to check for equality against this artifact identifier.
        Returns:
        true if the artifact identifiers are equal, false otherwise.
      • fromString

        public static ManifestIdentifier fromString​(java.lang.String string)
        Parses the specified string and converts it into a well-formatted Artifact identifier.
        Parameters:
        string - string to parse.
        Returns:
        ArtifactIdentifier instance representing the specified string.
      • withVersion

        public ArtifactIdentifier withVersion​(java.lang.String version)
        Constructs an anonymized ArtifactIdentifier instance, without the version component.
        Returns:
        ArtifactIdentifier without a version component.