Package org.eclipse.aether.resolution
Class MetadataResult
- java.lang.Object
-
- org.eclipse.aether.resolution.MetadataResult
-
public final class MetadataResult extends java.lang.ObjectThe result of a metadata resolution request.
-
-
Constructor Summary
Constructors Constructor Description MetadataResult(MetadataRequest request)Creates a new result for the specified request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ExceptiongetException()Gets the exception that occurred while resolving the metadata.MetadatagetMetadata()Gets the resolved metadata (if any).MetadataRequestgetRequest()Gets the resolution request that was made.booleanisMissing()Indicates whether the requested metadata is not present in the remote repository.booleanisResolved()Indicates whether the requested metadata was resolved.booleanisUpdated()Indicates whether the metadata was actually fetched from the remote repository or resolved from the local cache.MetadataResultsetException(java.lang.Exception exception)Records the specified exception while resolving the metadata.MetadataResultsetMetadata(Metadata metadata)Sets the resolved metadata.MetadataResultsetUpdated(boolean updated)Sets the updated flag for the metadata.java.lang.StringtoString()
-
-
-
Field Detail
-
request
private final MetadataRequest request
-
exception
private java.lang.Exception exception
-
updated
private boolean updated
-
metadata
private Metadata metadata
-
-
Constructor Detail
-
MetadataResult
public MetadataResult(MetadataRequest request)
Creates a new result for the specified request.- Parameters:
request- The resolution request, must not benull.
-
-
Method Detail
-
getRequest
public MetadataRequest getRequest()
Gets the resolution request that was made.- Returns:
- The resolution request, never
null.
-
getMetadata
public Metadata getMetadata()
Gets the resolved metadata (if any).- Returns:
- The resolved metadata or
nullif the resolution failed.
-
setMetadata
public MetadataResult setMetadata(Metadata metadata)
Sets the resolved metadata.- Parameters:
metadata- The resolved metadata, may benullif the resolution failed.- Returns:
- This result for chaining, never
null.
-
setException
public MetadataResult setException(java.lang.Exception exception)
Records the specified exception while resolving the metadata.- Parameters:
exception- The exception to record, may benull.- Returns:
- This result for chaining, never
null.
-
getException
public java.lang.Exception getException()
Gets the exception that occurred while resolving the metadata.- Returns:
- The exception that occurred or
nullif none.
-
setUpdated
public MetadataResult setUpdated(boolean updated)
Sets the updated flag for the metadata.- Parameters:
updated-trueif the metadata was actually fetched from the remote repository during the resolution,falseif 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:
trueif the metadata was actually fetched from the remote repository during the resolution,falseif 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) despitegetException()indicating a transfer error while trying to refetch the metadata from the remote repository.- Returns:
trueif the metadata was resolved,falseotherwise.- See Also:
Metadata.getFile()
-
isMissing
public boolean isMissing()
Indicates whether the requested metadata is not present in the remote repository.- Returns:
trueif the metadata is not present in the remote repository,falseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-