Class MavenVersionComparator

java.lang.Object
com.soebes.itf.jupiter.extension.MavenVersionComparator
All Implemented Interfaces:
Comparable<MavenVersionComparator>

@API(status=INTERNAL, since="0.13.0") public final class MavenVersionComparator extends Object implements Comparable<MavenVersionComparator>
Author:
Karl Heinz Marbaise
  • Method Details

    • of

      public static MavenVersionComparator of()
      Define a MavenVersionComparator which identifies any version to be equal to it.
      Returns:
      MavenVersionComparator.
    • of

      public static MavenVersionComparator of(int major)
      Define a MavenVersionComparator which identifies only the major version. Example: 3. That means in consequence that the following version will be seen as equal:
      • 3 == 3.6.0
      • 3 == 3.1.1
      • 3 == 3.1.1-alpha-1
      That means you are only interested in the major version.
      Parameters:
      major - The major version.
      Returns:
      MavenVersionComparator.
    • of

      public static MavenVersionComparator of(int major, int minor)
      Define a MavenVersionComparator which identifies only the major and minor version. Example: 3.6. That means in consequence that the following version will be seen as equal:
      • 3.6 == 3.6.0
      • 3.6 == 3.6.15
      • 3.6 == 3.6.15-alpha-2
      That means you are only interested in the major and minor version.
      Parameters:
      major - The major version.
      minor - The minor version.
      Returns:
      MavenVersionComparator.
    • of

      public static MavenVersionComparator of(int major, int minor, int patch)
      Define a MavenVersionComparator which identifies only the major, minor and patch version. Example: 3.6.1.
      Parameters:
      major - The major version.
      minor - The minor version.
      patch - The patch version.
      Returns:
      MavenVersionComparator.
    • of

      public static MavenVersionComparator of(int major, int minor, int patch, String qualifier, int qualifierNumber)
      Define a MavenVersionComparator which identifies only the major, minor, patch, qualifier and qualifierNumber. Example: 3.6.1-alpha-1.
      Parameters:
      major - The major version.
      minor - The minor version.
      patch - The patch version.
      qualifier - The qualifier version.
      qualifierNumber - The qualifierNumber version.
      Returns:
      MavenVersionComparator.
    • major

      public int major()
    • minor

      public int minor()
    • patch

      public int patch()
    • qualifier

      public String qualifier()
    • qualifierNumber

      public int qualifierNumber()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(MavenVersionComparator rhs)
      Specified by:
      compareTo in interface Comparable<MavenVersionComparator>