Package org.eclipse.aether.util.artifact
Class SubArtifact
- java.lang.Object
-
- org.eclipse.aether.artifact.AbstractArtifact
-
- org.eclipse.aether.util.artifact.SubArtifact
-
- All Implemented Interfaces:
Artifact
public final class SubArtifact extends AbstractArtifact
An artifact whose identity is derived from another artifact. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.
-
-
Constructor Summary
Constructors Constructor Description SubArtifact(Artifact mainArtifact, String classifier, String extension)
Creates a new sub artifact.SubArtifact(Artifact mainArtifact, String classifier, String extension, File file)
Creates a new sub artifact.SubArtifact(Artifact mainArtifact, String classifier, String extension, Map<String,String> properties)
Creates a new sub artifact.SubArtifact(Artifact mainArtifact, String classifier, String extension, Map<String,String> properties, File file)
Creates a new sub artifact.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getArtifactId()
String
getBaseVersion()
String
getClassifier()
String
getExtension()
File
getFile()
String
getGroupId()
Map<String,String>
getProperties()
String
getVersion()
boolean
isSnapshot()
Artifact
setFile(File file)
Artifact
setProperties(Map<String,String> properties)
-
Methods inherited from class org.eclipse.aether.artifact.AbstractArtifact
copyProperties, equals, getProperty, hashCode, setVersion, toString
-
-
-
-
Constructor Detail
-
SubArtifact
public SubArtifact(Artifact mainArtifact, String classifier, String extension)
Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.- Parameters:
mainArtifact
- The artifact from which to derive the identity, must not benull
.classifier
- The classifier for this artifact, may benull
if none.extension
- The extension for this artifact, may benull
if none.
-
SubArtifact
public SubArtifact(Artifact mainArtifact, String classifier, String extension, File file)
Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.- Parameters:
mainArtifact
- The artifact from which to derive the identity, must not benull
.classifier
- The classifier for this artifact, may benull
if none.extension
- The extension for this artifact, may benull
if none.file
- The file for this artifact, may benull
if unresolved.
-
SubArtifact
public SubArtifact(Artifact mainArtifact, String classifier, String extension, Map<String,String> properties)
Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.- Parameters:
mainArtifact
- The artifact from which to derive the identity, must not benull
.classifier
- The classifier for this artifact, may benull
if none.extension
- The extension for this artifact, may benull
if none.properties
- The properties of the artifact, may benull
.
-
SubArtifact
public SubArtifact(Artifact mainArtifact, String classifier, String extension, Map<String,String> properties, File file)
Creates a new sub artifact. The classifier and extension specified for this artifact may use the asterisk character "*" to refer to the corresponding property of the main artifact. For instance, the classifier "*-sources" can be used to refer to the source attachment of an artifact. Likewise, the extension "*.asc" can be used to refer to the GPG signature of an artifact.- Parameters:
mainArtifact
- The artifact from which to derive the identity, must not benull
.classifier
- The classifier for this artifact, may benull
if none.extension
- The extension for this artifact, may benull
if none.properties
- The properties of the artifact, may benull
.file
- The file for this artifact, may benull
if unresolved.
-
-
Method Detail
-
getGroupId
public String getGroupId()
-
getArtifactId
public String getArtifactId()
-
getVersion
public String getVersion()
-
getBaseVersion
public String getBaseVersion()
- Specified by:
getBaseVersion
in interfaceArtifact
- Overrides:
getBaseVersion
in classAbstractArtifact
-
isSnapshot
public boolean isSnapshot()
- Specified by:
isSnapshot
in interfaceArtifact
- Overrides:
isSnapshot
in classAbstractArtifact
-
getClassifier
public String getClassifier()
-
getExtension
public String getExtension()
-
setFile
public Artifact setFile(File file)
- Specified by:
setFile
in interfaceArtifact
- Overrides:
setFile
in classAbstractArtifact
-
getProperties
public Map<String,String> getProperties()
-
setProperties
public Artifact setProperties(Map<String,String> properties)
- Specified by:
setProperties
in interfaceArtifact
- Overrides:
setProperties
in classAbstractArtifact
-
-