org.sonatype.aether.resolution
Class VersionRequest

java.lang.Object
  extended by org.sonatype.aether.resolution.VersionRequest

public class VersionRequest
extends java.lang.Object

A request to resolve a metaversion.

Author:
Benjamin Bentmann
See Also:
RepositorySystem.resolveVersion(RepositorySystemSession, VersionRequest)

Constructor Summary
VersionRequest()
          Creates an uninitialized request.
VersionRequest(Artifact artifact, java.util.List<RemoteRepository> repositories, java.lang.String context)
          Creates a request with the specified properties.
 
Method Summary
 VersionRequest addRepository(RemoteRepository repository)
          Adds the specified repository for the resolution.
 Artifact getArtifact()
          Gets the artifact whose (meta-)version shall be resolved.
 java.util.List<RemoteRepository> getRepositories()
          Gets the repositories to resolve the version from.
 java.lang.String getRequestContext()
          Gets the context in which this request is made.
 VersionRequest setArtifact(Artifact artifact)
          Sets the artifact whose (meta-)version shall be resolved.
 VersionRequest setRepositories(java.util.List<RemoteRepository> repositories)
          Sets the repositories to resolve the version from.
 VersionRequest setRequestContext(java.lang.String context)
          Sets the context in which this request is made.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionRequest

public VersionRequest()
Creates an uninitialized request.


VersionRequest

public VersionRequest(Artifact artifact,
                      java.util.List<RemoteRepository> repositories,
                      java.lang.String context)
Creates a request with the specified properties.

Parameters:
artifact - The artifact whose (meta-)version should be resolved, may be null.
repositories - The repositories to resolve the version from, may be null.
context - The context in which this request is made, may be null.
Method Detail

getArtifact

public Artifact getArtifact()
Gets the artifact whose (meta-)version shall be resolved.

Returns:
The artifact or null if not set.

setArtifact

public VersionRequest setArtifact(Artifact artifact)
Sets the artifact whose (meta-)version shall be resolved.

Parameters:
artifact - The artifact, may be null.
Returns:
This request for chaining, never null.

getRepositories

public java.util.List<RemoteRepository> getRepositories()
Gets the repositories to resolve the version from.

Returns:
The repositories, never null.

setRepositories

public VersionRequest setRepositories(java.util.List<RemoteRepository> repositories)
Sets the repositories to resolve the version from.

Parameters:
repositories - The repositories, may be null.
Returns:
This request for chaining, never null.

addRepository

public VersionRequest addRepository(RemoteRepository repository)
Adds the specified repository for the resolution.

Parameters:
repository - The repository to add, may be null.
Returns:
This request for chaining, never null.

getRequestContext

public java.lang.String getRequestContext()
Gets the context in which this request is made.

Returns:
The context, never null.

setRequestContext

public VersionRequest setRequestContext(java.lang.String context)
Sets the context in which this request is made.

Parameters:
context - The context, may be null.
Returns:
This request for chaining, never null.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010 Sonatype, Inc.. All Rights Reserved.