Class LatestVersionMatcher
java.lang.Object
org.apache.ivy.plugins.version.AbstractVersionMatcher
org.apache.ivy.plugins.version.LatestVersionMatcher
- All Implemented Interfaces:
IvySettingsAware, VersionMatcher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(ModuleRevisionId askedMrid, ModuleDescriptor foundMD) Indicates if this version matcher considers that the module found matches the asked one.booleanaccept(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) Indicates if this version matcher considers that the module revision found matches the asked one.intcompare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator<ModuleRevisionId> staticComparator) If we don't need a module descriptor we can consider the dynamic revision to be greater.booleanisDynamic(ModuleRevisionId askedMrid) Indicates if the given asked ModuleRevisionId should be considered as dynamic for the current VersionMatcher or not.booleanneedModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) Indicates if this VersionMatcher needs module descriptors to determine if a module revision matches the asked one.Methods inherited from class AbstractVersionMatcher
getName, getSettings, setName, setSettings, toString
-
Constructor Details
-
LatestVersionMatcher
public LatestVersionMatcher()
-
-
Method Details
-
isDynamic
Description copied from interface:VersionMatcherIndicates if the given asked ModuleRevisionId should be considered as dynamic for the current VersionMatcher or not.- Parameters:
askedMrid- the dependency module revision id as asked by a module- Returns:
- true if this revision is considered as a dynamic one, false otherwise
-
accept
Description copied from interface:VersionMatcherIndicates if this version matcher considers that the module revision found matches the asked one.- Parameters:
askedMrid- ModuleRevisionIdfoundMrid- ModuleRevisionId- Returns:
- boolean
-
needModuleDescriptor
Description copied from interface:VersionMatcherIndicates if this VersionMatcher needs module descriptors to determine if a module revision matches the asked one. Note that returning true in this method may imply big performance issues.- Specified by:
needModuleDescriptorin interfaceVersionMatcher- Overrides:
needModuleDescriptorin classAbstractVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMrid- ModuleRevisionId- Returns:
- boolean
-
accept
Description copied from interface:VersionMatcherIndicates if this version matcher considers that the module found matches the asked one. This method can be called even needModuleDescriptor(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid) returns false, so it is required to implement it in any case, a usual default implementation being: return accept(askedMrid, foundMD.getResolvedModuleRevisionId());- Specified by:
acceptin interfaceVersionMatcher- Overrides:
acceptin classAbstractVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMD- ModuleDescriptor- Returns:
- boolean
-
compare
public int compare(ModuleRevisionId askedMrid, ModuleRevisionId foundMrid, Comparator<ModuleRevisionId> staticComparator) If we don't need a module descriptor we can consider the dynamic revision to be greater. If we need a module descriptor then we can't know which one is greater and return 0.- Specified by:
comparein interfaceVersionMatcher- Overrides:
comparein classAbstractVersionMatcher- Parameters:
askedMrid- ModuleRevisionIdfoundMrid- ModuleRevisionIdstaticComparator- Comparator- Returns:
- int
-