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 StringgetArtifactId()StringgetBaseVersion()StringgetClassifier()StringgetExtension()FilegetFile()StringgetGroupId()Map<String,String>getProperties()StringgetVersion()booleanisSnapshot()ArtifactsetFile(File file)ArtifactsetProperties(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 benullif none.extension- The extension for this artifact, may benullif 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 benullif none.extension- The extension for this artifact, may benullif none.file- The file for this artifact, may benullif 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 benullif none.extension- The extension for this artifact, may benullif 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 benullif none.extension- The extension for this artifact, may benullif none.properties- The properties of the artifact, may benull.file- The file for this artifact, may benullif unresolved.
-
-
Method Detail
-
getGroupId
public String getGroupId()
-
getArtifactId
public String getArtifactId()
-
getVersion
public String getVersion()
-
getBaseVersion
public String getBaseVersion()
- Specified by:
getBaseVersionin interfaceArtifact- Overrides:
getBaseVersionin classAbstractArtifact
-
isSnapshot
public boolean isSnapshot()
- Specified by:
isSnapshotin interfaceArtifact- Overrides:
isSnapshotin classAbstractArtifact
-
getClassifier
public String getClassifier()
-
getExtension
public String getExtension()
-
setFile
public Artifact setFile(File file)
- Specified by:
setFilein interfaceArtifact- Overrides:
setFilein classAbstractArtifact
-
getProperties
public Map<String,String> getProperties()
-
setProperties
public Artifact setProperties(Map<String,String> properties)
- Specified by:
setPropertiesin interfaceArtifact- Overrides:
setPropertiesin classAbstractArtifact
-
-