Class MetadataResult

java.lang.Object
org.eclipse.aether.resolution.MetadataResult

public final class MetadataResult extends Object
The result of a metadata resolution request.
See Also:
  • Constructor Details

    • MetadataResult

      Creates a new result for the specified request.
      Parameters:
      request - The resolution request, must not be null.
  • Method Details

    • getRequest

      Gets the resolution request that was made.
      Returns:
      The resolution request, never null.
    • getMetadata

      Gets the resolved metadata (if any).
      Returns:
      The resolved metadata or null if the resolution failed.
    • setMetadata

      public MetadataResult setMetadata(Metadata metadata)
      Sets the resolved metadata.
      Parameters:
      metadata - The resolved metadata, may be null if the resolution failed.
      Returns:
      This result for chaining, never null.
    • setException

      Records the specified exception while resolving the metadata.
      Parameters:
      exception - The exception to record, may be null.
      Returns:
      This result for chaining, never null.
    • getException

      Gets the exception that occurred while resolving the metadata.
      Returns:
      The exception that occurred or null if none.
    • setUpdated

      public MetadataResult setUpdated(boolean updated)
      Sets the updated flag for the metadata.
      Parameters:
      updated - true if the metadata was actually fetched from the remote repository during the resolution, false if the metadata was resolved from a locally cached copy.
      Returns:
      This result for chaining, never null.
    • isUpdated

      public boolean isUpdated()
      Indicates whether the metadata was actually fetched from the remote repository or resolved from the local cache. If metadata has been locally cached during a previous resolution request and this local copy is still up-to-date according to the remote repository's update policy, no remote access is made.
      Returns:
      true if the metadata was actually fetched from the remote repository during the resolution, false if the metadata was resolved from a locally cached copy.
    • isResolved

      public boolean isResolved()
      Indicates whether the requested metadata was resolved. Note that the metadata might have been successfully resolved (from the local cache) despite getException() indicating a transfer error while trying to refetch the metadata from the remote repository.
      Returns:
      true if the metadata was resolved, false otherwise.
      See Also:
    • isMissing

      public boolean isMissing()
      Indicates whether the requested metadata is not present in the remote repository.
      Returns:
      true if the metadata is not present in the remote repository, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object