Class ArtifactVersionsCache

java.lang.Object
org.codehaus.mojo.versions.api.ArtifactVersionsCache

public class ArtifactVersionsCache extends Object
  • 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 given ArtifactVersions object and the given update scope. If the information is already present in cache, the cached version is returned. Otherwise, the artifactVersions object is queried and the response is cached.
      Type Parameters:
      V - concrete implementation of AbstractVersionDetails
      R - return type of the cached function
      Parameters:
      artifactVersions - ArtifactVersions object referring to the given dependency
      updateScope - update scope
      allowSnapshots - whether snapshots should be included
      Returns:
      last retrieved update information