Class VersionPrefixRestriction
- java.lang.Object
-
- org.jboss.set.mavendependencyupdater.rules.VersionPrefixRestriction
-
- All Implemented Interfaces:
Restriction
public class VersionPrefixRestriction extends Object implements Restriction
Restricts candidate versions to those that match specified version prefix. E.g. `prefix` "1.1" matches versions "1.1", "1.1.1", "1.1.2-qualifier", but doesn't match versions "1.10" or "1.2". This restriction also allows to specify `remainderRegex`, which is a regular expression pattern that's gonna be used to match remaining part of the version (the part not covered by the `prefix`). E.g. `prefix` "1.1" with `remainderRegex` "redhat-\\d+" would match versions "1.1.redhat-00001" or "1.1-redhat-00001" but not version "1.1.1.redhat-00001" (i.e. micro being added where it was originally missing is not accepted).
-
-
Constructor Summary
Constructors Constructor Description VersionPrefixRestriction(String prefixString)VersionPrefixRestriction(String prefix, String remainderRegex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplies(String versionString, String originalVersion)Applies the restriction.StringgetPrefixString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.set.mavendependencyupdater.rules.Restriction
applies
-
-
-
-
Method Detail
-
applies
public boolean applies(String versionString, String originalVersion)
Description copied from interface:RestrictionApplies the restriction.- Specified by:
appliesin interfaceRestriction- Parameters:
versionString- candidate version stringoriginalVersion- original version string- Returns:
- true if given version passed the restriction test (version can be considered candidate for upgrading)
-
getPrefixString
public String getPrefixString()
-
-