org.sonatype.aether.resolution
Class VersionResult

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

public class VersionResult
extends Object

The result of a version resolution request.

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

Constructor Summary
VersionResult(VersionRequest request)
          Creates a new result for the specified request.
 
Method Summary
 VersionResult addException(Exception exception)
          Records the specified exception while resolving the version.
 List<Exception> getExceptions()
          Gets the exceptions that occurred while resolving the version.
 ArtifactRepository getRepository()
          Gets the repository from which the version was eventually resolved.
 VersionRequest getRequest()
          Gets the resolution request that was made.
 String getVersion()
          Gets the resolved version.
 VersionResult setRepository(ArtifactRepository repository)
          Sets the repository from which the version was resolved.
 VersionResult setVersion(String version)
          Sets the resolved version.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionResult

public VersionResult(VersionRequest request)
Creates a new result for the specified request.

Parameters:
request - The resolution request, must not be null.
Method Detail

getRequest

public VersionRequest getRequest()
Gets the resolution request that was made.

Returns:
The resolution request, never null.

getExceptions

public List<Exception> getExceptions()
Gets the exceptions that occurred while resolving the version.

Returns:
The exceptions that occurred, never null.

addException

public VersionResult addException(Exception exception)
Records the specified exception while resolving the version.

Parameters:
exception - The exception to record, may be null.
Returns:
This result for chaining, never null.

getVersion

public String getVersion()
Gets the resolved version.

Returns:
The resolved version or null if the resolution failed.

setVersion

public VersionResult setVersion(String version)
Sets the resolved version.

Parameters:
version - The resolved version, may be null.
Returns:
This result for chaining, never null.

getRepository

public ArtifactRepository getRepository()
Gets the repository from which the version was eventually resolved.

Returns:
The repository from which the version was resolved or null if unknown.

setRepository

public VersionResult setRepository(ArtifactRepository repository)
Sets the repository from which the version was resolved.

Parameters:
repository - The repository from which the version was resolved, may be null.
Returns:
This result for chaining, never null.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012. All Rights Reserved.