Package org.eclipse.aether.resolution
Class ArtifactDescriptorResult
- java.lang.Object
-
- org.eclipse.aether.resolution.ArtifactDescriptorResult
-
public final class ArtifactDescriptorResult extends java.lang.ObjectThe result from reading an artifact descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<Artifact>aliasesprivate Artifactartifactprivate java.util.List<Dependency>dependenciesprivate java.util.List<java.lang.Exception>exceptionsprivate java.util.List<Dependency>managedDependenciesprivate java.util.Map<java.lang.String,java.lang.Object>propertiesprivate java.util.List<Artifact>relocationsprivate java.util.List<RemoteRepository>repositoriesprivate ArtifactRepositoryrepositoryprivate ArtifactDescriptorRequestrequest
-
Constructor Summary
Constructors Constructor Description ArtifactDescriptorResult(ArtifactDescriptorRequest request)Creates a new result for the specified request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactDescriptorResultaddAlias(Artifact alias)Records the specified alias.ArtifactDescriptorResultaddDependency(Dependency dependency)Adds the specified direct dependency.ArtifactDescriptorResultaddException(java.lang.Exception exception)Records the specified exception while reading the artifact descriptor.ArtifactDescriptorResultaddManagedDependency(Dependency dependency)Adds the specified managed dependency.ArtifactDescriptorResultaddRelocation(Artifact artifact)Records the specified relocation hop while locating the artifact descriptor.ArtifactDescriptorResultaddRepository(RemoteRepository repository)Adds the specified remote repository.java.util.Collection<Artifact>getAliases()Gets the known aliases for this artifact.ArtifactgetArtifact()Gets the artifact whose descriptor was read.java.util.List<Dependency>getDependencies()Gets the list of direct dependencies of the artifact.java.util.List<java.lang.Exception>getExceptions()Gets the exceptions that occurred while reading the artifact descriptor.java.util.List<Dependency>getManagedDependencies()Gets the dependency management information.java.util.Map<java.lang.String,java.lang.Object>getProperties()Gets any additional information about the artifact in form of key-value pairs.java.util.List<Artifact>getRelocations()Gets the relocations that were processed to read the artifact descriptor.java.util.List<RemoteRepository>getRepositories()Gets the remote repositories listed in the artifact descriptor.ArtifactRepositorygetRepository()Gets the repository from which the descriptor was eventually resolved.ArtifactDescriptorRequestgetRequest()Gets the descriptor request that was made.ArtifactDescriptorResultsetAliases(java.util.Collection<Artifact> aliases)Sets the aliases of the artifact.ArtifactDescriptorResultsetArtifact(Artifact artifact)Sets the artifact whose descriptor was read.ArtifactDescriptorResultsetDependencies(java.util.List<Dependency> dependencies)Sets the list of direct dependencies of the artifact.ArtifactDescriptorResultsetExceptions(java.util.List<java.lang.Exception> exceptions)Sets the exceptions that occurred while reading the artifact descriptor.ArtifactDescriptorResultsetManagedDependencies(java.util.List<Dependency> dependencies)Sets the dependency management information.ArtifactDescriptorResultsetProperties(java.util.Map<java.lang.String,java.lang.Object> properties)Sets any additional information about the artifact in form of key-value pairs.ArtifactDescriptorResultsetRelocations(java.util.List<Artifact> relocations)Sets the relocations that were processed to read the artifact descriptor.ArtifactDescriptorResultsetRepositories(java.util.List<RemoteRepository> repositories)Sets the remote repositories listed in the artifact descriptor.ArtifactDescriptorResultsetRepository(ArtifactRepository repository)Sets the repository from which the descriptor was resolved.java.lang.StringtoString()
-
-
-
Field Detail
-
request
private final ArtifactDescriptorRequest request
-
exceptions
private java.util.List<java.lang.Exception> exceptions
-
relocations
private java.util.List<Artifact> relocations
-
aliases
private java.util.Collection<Artifact> aliases
-
artifact
private Artifact artifact
-
repository
private ArtifactRepository repository
-
dependencies
private java.util.List<Dependency> dependencies
-
managedDependencies
private java.util.List<Dependency> managedDependencies
-
repositories
private java.util.List<RemoteRepository> repositories
-
properties
private java.util.Map<java.lang.String,java.lang.Object> properties
-
-
Constructor Detail
-
ArtifactDescriptorResult
public ArtifactDescriptorResult(ArtifactDescriptorRequest request)
Creates a new result for the specified request.- Parameters:
request- The descriptor request, must not benull.
-
-
Method Detail
-
getRequest
public ArtifactDescriptorRequest getRequest()
Gets the descriptor request that was made.- Returns:
- The descriptor request, never
null.
-
getExceptions
public java.util.List<java.lang.Exception> getExceptions()
Gets the exceptions that occurred while reading the artifact descriptor.- Returns:
- The exceptions that occurred, never
null.
-
setExceptions
public ArtifactDescriptorResult setExceptions(java.util.List<java.lang.Exception> exceptions)
Sets the exceptions that occurred while reading the artifact descriptor.- Parameters:
exceptions- The exceptions that occurred, may benull.- Returns:
- This result for chaining, never
null.
-
addException
public ArtifactDescriptorResult addException(java.lang.Exception exception)
Records the specified exception while reading the artifact descriptor.- Parameters:
exception- The exception to record, may benull.- Returns:
- This result for chaining, never
null.
-
getRelocations
public java.util.List<Artifact> getRelocations()
Gets the relocations that were processed to read the artifact descriptor. The returned list denotes the hops that lead to the final artifact coordinates as given bygetArtifact().- Returns:
- The relocations that were processed, never
null.
-
setRelocations
public ArtifactDescriptorResult setRelocations(java.util.List<Artifact> relocations)
Sets the relocations that were processed to read the artifact descriptor.- Parameters:
relocations- The relocations that were processed, may benull.- Returns:
- This result for chaining, never
null.
-
addRelocation
public ArtifactDescriptorResult addRelocation(Artifact artifact)
Records the specified relocation hop while locating the artifact descriptor.- Parameters:
artifact- The artifact that got relocated, may benull.- Returns:
- This result for chaining, never
null.
-
getAliases
public java.util.Collection<Artifact> getAliases()
Gets the known aliases for this artifact. An alias denotes a different artifact with (almost) the same contents and can be used to mark a patched rebuild of some other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as a conflict.- Returns:
- The aliases of the artifact, never
null.
-
setAliases
public ArtifactDescriptorResult setAliases(java.util.Collection<Artifact> aliases)
Sets the aliases of the artifact.- Parameters:
aliases- The aliases of the artifact, may benull.- Returns:
- This result for chaining, never
null.
-
addAlias
public ArtifactDescriptorResult addAlias(Artifact alias)
Records the specified alias.- Parameters:
alias- The alias for the artifact, may benull.- Returns:
- This result for chaining, never
null.
-
getArtifact
public Artifact getArtifact()
Gets the artifact whose descriptor was read. This can be a different artifact than originally requested in case relocations were encountered.- Returns:
- The artifact after following any relocations, never
null.
-
setArtifact
public ArtifactDescriptorResult setArtifact(Artifact artifact)
Sets the artifact whose descriptor was read.- Parameters:
artifact- The artifact whose descriptor was read, may benull.- Returns:
- This result for chaining, never
null.
-
getRepository
public ArtifactRepository getRepository()
Gets the repository from which the descriptor was eventually resolved.- Returns:
- The repository from which the descriptor was resolved or
nullif unknown.
-
setRepository
public ArtifactDescriptorResult setRepository(ArtifactRepository repository)
Sets the repository from which the descriptor was resolved.- Parameters:
repository- The repository from which the descriptor was resolved, may benull.- Returns:
- This result for chaining, never
null.
-
getDependencies
public java.util.List<Dependency> getDependencies()
Gets the list of direct dependencies of the artifact.- Returns:
- The list of direct dependencies, never
null
-
setDependencies
public ArtifactDescriptorResult setDependencies(java.util.List<Dependency> dependencies)
Sets the list of direct dependencies of the artifact.- Parameters:
dependencies- The list of direct dependencies, may benull- Returns:
- This result for chaining, never
null.
-
addDependency
public ArtifactDescriptorResult addDependency(Dependency dependency)
Adds the specified direct dependency.- Parameters:
dependency- The direct dependency to add, may benull.- Returns:
- This result for chaining, never
null.
-
getManagedDependencies
public java.util.List<Dependency> getManagedDependencies()
Gets the dependency management information.- Returns:
- The dependency management information.
-
setManagedDependencies
public ArtifactDescriptorResult setManagedDependencies(java.util.List<Dependency> dependencies)
Sets the dependency management information.- Parameters:
dependencies- The dependency management information, may benull.- Returns:
- This result for chaining, never
null.
-
addManagedDependency
public ArtifactDescriptorResult addManagedDependency(Dependency dependency)
Adds the specified managed dependency.- Parameters:
dependency- The managed dependency to add, may benull.- Returns:
- This result for chaining, never
null.
-
getRepositories
public java.util.List<RemoteRepository> getRepositories()
Gets the remote repositories listed in the artifact descriptor.- Returns:
- The remote repositories listed in the artifact descriptor, never
null.
-
setRepositories
public ArtifactDescriptorResult setRepositories(java.util.List<RemoteRepository> repositories)
Sets the remote repositories listed in the artifact descriptor.- Parameters:
repositories- The remote repositories listed in the artifact descriptor, may benull.- Returns:
- This result for chaining, never
null.
-
addRepository
public ArtifactDescriptorResult addRepository(RemoteRepository repository)
Adds the specified remote repository.- Parameters:
repository- The remote repository to add, may benull.- Returns:
- This result for chaining, never
null.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Gets any additional information about the artifact in form of key-value pairs. Note: Regardless of their actual type, all property values must be treated as being read-only.- Returns:
- The additional information about the artifact, never
null.
-
setProperties
public ArtifactDescriptorResult setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Sets any additional information about the artifact in form of key-value pairs.- Parameters:
properties- The additional information about the artifact, may benull.- Returns:
- This result for chaining, never
null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-