Package org.eclipse.aether.artifact
Class AbstractArtifact
- java.lang.Object
-
- org.eclipse.aether.artifact.AbstractArtifact
-
- All Implemented Interfaces:
Artifact
- Direct Known Subclasses:
DefaultArtifact
,DelegatingArtifact
,SubArtifact
public abstract class AbstractArtifact extends Object implements Artifact
A skeleton class for artifacts.
-
-
Constructor Summary
Constructors Constructor Description AbstractArtifact()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Map<String,String>
copyProperties(Map<String,String> properties)
Copies the specified artifact properties.boolean
equals(Object obj)
Compares this artifact with the specified object.String
getBaseVersion()
Gets the base version of this artifact, for example "1.0-SNAPSHOT".String
getProperty(String key, String defaultValue)
Gets the specified property.int
hashCode()
Returns a hash code for this artifact.boolean
isSnapshot()
Determines whether this artifact uses a snapshot version.Artifact
setFile(File file)
Sets the file of the artifact.Artifact
setProperties(Map<String,String> properties)
Sets the properties for the artifact.Artifact
setVersion(String version)
Sets the version of the artifact.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.aether.artifact.Artifact
getArtifactId, getClassifier, getExtension, getFile, getGroupId, getProperties, getVersion
-
-
-
-
Constructor Detail
-
AbstractArtifact
public AbstractArtifact()
-
-
Method Detail
-
isSnapshot
public boolean isSnapshot()
Description copied from interface:Artifact
Determines whether this artifact uses a snapshot version.- Specified by:
isSnapshot
in interfaceArtifact
- Returns:
true
if the artifact is a snapshot,false
otherwise.
-
getBaseVersion
public String getBaseVersion()
Description copied from interface:Artifact
Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to theArtifact.getVersion()
, the base version will always refer to the unresolved meta version.- Specified by:
getBaseVersion
in interfaceArtifact
- Returns:
- The base version, never
null
.
-
setVersion
public Artifact setVersion(String version)
Description copied from interface:Artifact
Sets the version of the artifact.- Specified by:
setVersion
in interfaceArtifact
- Parameters:
version
- The version of this artifact, may benull
or empty.- Returns:
- The new artifact, never
null
.
-
setFile
public Artifact setFile(File file)
Description copied from interface:Artifact
Sets the file of the artifact.
-
setProperties
public Artifact setProperties(Map<String,String> properties)
Description copied from interface:Artifact
Sets the properties for the artifact. Note that these properties exist merely in memory and are not persisted when the artifact gets installed/deployed to a repository.- Specified by:
setProperties
in interfaceArtifact
- Parameters:
properties
- The properties for the artifact, may benull
.- Returns:
- The new artifact, never
null
. - See Also:
ArtifactProperties
-
getProperty
public String getProperty(String key, String defaultValue)
Description copied from interface:Artifact
Gets the specified property.- Specified by:
getProperty
in interfaceArtifact
- Parameters:
key
- The name of the property, must not benull
.defaultValue
- The default value to return in case the property is not set, may benull
.- Returns:
- The requested property value or
null
if the property is not set and no default value was provided. - See Also:
ArtifactProperties
-
copyProperties
protected static Map<String,String> copyProperties(Map<String,String> properties)
Copies the specified artifact properties. This utility method should be used when creating new artifact instances with caller-supplied properties.- Parameters:
properties
- The properties to copy, may benull
.- Returns:
- The copied and read-only properties, never
null
.
-
-