Package io.manebot.artifact
Class ManifestIdentifier
- java.lang.Object
- 
- io.manebot.artifact.ManifestIdentifier
 
- 
- Direct Known Subclasses:
- ArtifactIdentifier
 
 public class ManifestIdentifier extends java.lang.ObjectDescribes 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 SummaryConstructors Constructor Description ManifestIdentifier(java.lang.String packageId, java.lang.String artifactId)Constructs a new artifact identifier.
 - 
Method SummaryModifier and Type Method Description booleanequals(ManifestIdentifier b)Checks for equality between two ArtifactIdentifiers.booleanequals(java.lang.Object b)static ManifestIdentifierfromString(java.lang.String string)Parses the specified string and converts it into a well-formatted Artifact identifier.java.lang.StringgetArtifactId()Gets the artifactId associated with this artifact identifier.java.lang.StringgetPackageId()Gets the packageId associated with this artifact identifier.inthashCode()java.lang.StringtoString()Converts this artifact identifier to a string.ArtifactIdentifierwithVersion(java.lang.String version)Constructs an anonymized ArtifactIdentifier instance, without the version component.
 
- 
- 
- 
Method Detail- 
getArtifactIdpublic final java.lang.String getArtifactId() Gets the artifactId associated with this artifact identifier.- Returns:
- artifactId.
 
 - 
getPackageIdpublic final java.lang.String getPackageId() Gets the packageId associated with this artifact identifier.- Returns:
- packageId.
 
 - 
toStringpublic 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:
- toStringin class- java.lang.Object
- Returns:
- the ArtifactIdentifier's string representation.
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object b) - Overrides:
- equalsin class- java.lang.Object
 
 - 
equalspublic 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.
 
 - 
fromStringpublic 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.
 
 - 
withVersionpublic ArtifactIdentifier withVersion(java.lang.String version) Constructs an anonymized ArtifactIdentifier instance, without the version component.- Returns:
- ArtifactIdentifier without a version component.
 
 
- 
 
-