Package org.codehaus.mojo.versions.api
Class ArtifactVersionsCache
java.lang.Object
org.codehaus.mojo.versions.api.ArtifactVersionsCache
Utility providing a cached
AbstractVersionDetails.getNewestUpdateWithinSegment(Optional, boolean) API-
Constructor Summary
ConstructorsConstructorDescriptionArtifactVersionsCache(org.apache.commons.lang3.function.TriFunction<AbstractVersionDetails, Optional<Segment>, Boolean, ?> cachedFunction) Constructs a new instance given the concrete function for obtaining the details -
Method Summary
Modifier and TypeMethodDescription<V extends AbstractVersionDetails,R>
RReturns the required information for the givenArtifactVersionsobject and the given update scope.
-
Constructor Details
-
ArtifactVersionsCache
public ArtifactVersionsCache(org.apache.commons.lang3.function.TriFunction<AbstractVersionDetails, Optional<Segment>, Boolean, ?> cachedFunction) Constructs a new instance given the concrete function for obtaining the details- Parameters:
cachedFunction- reference to the function computing the required information
-
-
Method Details
-
get
public <V extends AbstractVersionDetails,R> R get(V artifactVersions, Optional<Segment> updateScope, boolean allowSnapshots) Returns the required information for the givenArtifactVersionsobject and the given update scope. If the information is already present in cache, the cached version is returned. Otherwise, theartifactVersionsobject is queried and the response is cached.- Type Parameters:
V- concrete implementation of AbstractVersionDetailsR- return type of the cached function- Parameters:
artifactVersions- ArtifactVersions object referring to the given dependencyupdateScope- update scopeallowSnapshots- whether snapshots should be included- Returns:
- last retrieved update information
-