public interface VersionClassifierPlugin extends ModulePlugin, Comparator<Version>
Version's of the Module.
Note that Version's generally represent source-level versions, or tags, as
opposed to artifact-level versions. That is so since Dragom is designed to work
more at the source level than at the artifact level and provides mapping
mechanisms between the two versioning contexts
(ArtifactVersionMapperPlugin).
Among others, Version classification is used in reference graph reports.
One way Version's can be classified is by establishing an order among them so that we can know if a given Version is greater or less than another Version, the meaning of this order being generally related to the set of changes included, and to some extent to the date at which the Version's were created, although a more recently created Version does not necessarily contain more changes than others (e.g., hotfix changes).
For example S/v-1.3 > S/v-1.2.3 > S/v-1.2.2 generally holds true.
Different versioning strategies can be used for different Module's so
that different Version classifications strategies can be used.
The distinction that Dragom makes between static and dynamic Version's is a form of classification that is global and embedded in the Version itself, not specific to Module's. But this plugin needs to consider these two general types of Version's. It is up to the plugin implementation to use a strategy that is meaningful to users, even if mixed comparisons between static and dynamic Versions does not always make complete sense.
For example, saying that all dynamic Version's are greater than static Version's generally leads to meaningful results, since we understand that new changes can always be added to dynamic Version's. But then again, if different evolution paths exist for a given Module, as is often the case for Web services for which multiple major Version's are often concurrently maintained, a static Version of a more recent evolution path could be considered greater than a dynamic Version of an older evolution path.
This interface extends Comparator<Version> to make it easy to use it in
conjunction with the Java Collections framework, such as to perform sort
operations.
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Version version1,
Version version2)
Compares two
Version's. |
int |
compareEvolutionPaths(String evolutionPath1,
String evolutionPath2)
Compares two evolution paths.
|
String |
getEvolutionPath(Version version)
Returns the evolution path associated with a Version.
|
getModulegetNodecomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongint compare(Version version1, Version version2)
Version's.
0 should be returned if and only if version1.equals(version2). That is,
Version equality should not be dependent on the classification strategy.compare in interface Comparator<Version>version1 - First Version.version2 - Second Version.String getEvolutionPath(Version version)
Currently Dragom does not manage evolution paths. But it is expected that this information be eventually exploited by some new functionality.
version - Version.int compareEvolutionPaths(String evolutionPath1, String evolutionPath2)
Currently Dragom does not manage evolution paths. But it is expected that this information be eventually exploited by some new functionnality.
evolutionPath1 - First evolution path.evolutionPath2 - Second evolution path.Copyright © 2015–2017 AZYVA INC.. All rights reserved.