Class HighestVersionFilter
- java.lang.Object
-
- org.eclipse.aether.util.graph.version.HighestVersionFilter
-
- All Implemented Interfaces:
VersionFilter
public final class HighestVersionFilter extends java.lang.Object implements VersionFilter
A version filter that excludes any version except the highest one.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.aether.collection.VersionFilter
VersionFilter.VersionFilterContext
-
-
Constructor Summary
Constructors Constructor Description HighestVersionFilter()Creates a new instance of this version filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionFilterderiveChildFilter(DependencyCollectionContext context)Derives a version filter for the specified collection context.booleanequals(java.lang.Object obj)voidfilterVersions(VersionFilter.VersionFilterContext context)Filters the available versions for a given dependency.inthashCode()
-
-
-
Method Detail
-
filterVersions
public void filterVersions(VersionFilter.VersionFilterContext context)
Description copied from interface:VersionFilterFilters the available versions for a given dependency. Implementations will usually callcontext.iterator()to inspect the available versions and useIterator.remove()to delete unacceptable versions. If no versions remain after all filtering has been performed, the dependency collection process will automatically fail, i.e. implementations need not handle this situation on their own.- Specified by:
filterVersionsin interfaceVersionFilter- Parameters:
context- The version filter context, must not benull.
-
deriveChildFilter
public VersionFilter deriveChildFilter(DependencyCollectionContext context)
Description copied from interface:VersionFilterDerives a version filter for the specified collection context. The derived filter will be used to handle version ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.- Specified by:
deriveChildFilterin interfaceVersionFilter- Parameters:
context- The dependency collection context, must not benull.- Returns:
- The version filter for the target node or
nullif versions should not be filtered any more.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-