Interface VersionConstraint
- All Known Implementing Classes:
CaretConstraint,CompositeConstraint,ExactVersionConstraint,OrConstraint,RangeConstraint,TildeConstraint
This interface allows diverse implementations for different types of version constraints, such as ranges, exact matches, or semantic versioning rules.
The constraints may define minimum and/or maximum boundary conditions, equality rules, or complex logical combinations of multiple constraints.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the lowest version that satisfies the version constraint.Retrieves the highest version defined by the version constraint.Retrieves a list of version constraints represented as strings.original()Retrieves the original constraint string as it was input or defined.booleanDetermines if the given version satisfies the constraints defined by this implementation.
-
Method Details
-
satisfies
Determines if the given version satisfies the constraints defined by this implementation.- Parameters:
version- the version to be checked against the constraints- Returns:
- true if the version satisfies the constraints, false otherwise
-
original
String original()Retrieves the original constraint string as it was input or defined.- Returns:
- the original version constraint string that was used to create this constraint.
-
getVersions
Retrieves a list of version constraints represented as strings.This method aggregates all conditions that define valid versions and returns them in a standardized string format for further interpretation or display.
- Returns:
- a list of strings where each string specifies a version constraint.
-
getLowVersion
String getLowVersion()Retrieves the lowest version that satisfies the version constraint.The result depends on how the specific implementation computes the lowest version. It may return null if the constraint defines no minimum version.
- Returns:
- the lowest version as a string
-
getMaxVersion
String getMaxVersion()Retrieves the highest version defined by the version constraint.Depending on the implementing class, this may involve calculating the maximum version based on one or more underlying version constraints.
- Returns:
- the maximum version as a string
-