Package org.eclipse.aether.util.artifact
Class DelegatingArtifact
- java.lang.Object
-
- org.eclipse.aether.artifact.AbstractArtifact
-
- org.eclipse.aether.util.artifact.DelegatingArtifact
-
- All Implemented Interfaces:
Artifact
public abstract class DelegatingArtifact extends AbstractArtifact
An artifact that delegates to another artifact instance. This class serves as a base for subclasses that want to carry additional data fields.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DelegatingArtifact(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getArtifactId()
String
getBaseVersion()
String
getClassifier()
String
getExtension()
File
getFile()
String
getGroupId()
Map<String,String>
getProperties()
String
getProperty(String key, String defaultValue)
String
getVersion()
int
hashCode()
boolean
isSnapshot()
protected abstract DelegatingArtifact
newInstance(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.Artifact
setFile(File file)
Artifact
setProperties(Map<String,String> properties)
Artifact
setVersion(String version)
String
toString()
-
Methods inherited from class org.eclipse.aether.artifact.AbstractArtifact
copyProperties
-
-
-
-
Constructor Detail
-
DelegatingArtifact
protected DelegatingArtifact(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact.- Parameters:
delegate
- The artifact to delegate to, must not benull
.
-
-
Method Detail
-
newInstance
protected abstract DelegatingArtifact newInstance(Artifact delegate)
Creates a new artifact instance that delegates to the specified artifact. Subclasses should use this hook to instantiate themselves, taking along any data from the current instance that was added.- Parameters:
delegate
- The artifact to delegate to, must not benull
.- Returns:
- The new delegating artifact, never
null
.
-
getGroupId
public String getGroupId()
-
getArtifactId
public String getArtifactId()
-
getVersion
public String getVersion()
-
setVersion
public Artifact setVersion(String version)
- Specified by:
setVersion
in interfaceArtifact
- Overrides:
setVersion
in classAbstractArtifact
-
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
-
getProperty
public String getProperty(String key, String defaultValue)
- Specified by:
getProperty
in interfaceArtifact
- Overrides:
getProperty
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
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractArtifact
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractArtifact
-
toString
public String toString()
- Overrides:
toString
in classAbstractArtifact
-
-