Class TestVersionRange

java.lang.Object
org.eclipse.aether.internal.test.util.TestVersionRange
All Implemented Interfaces:
VersionRange

final class TestVersionRange extends Object implements VersionRange
A version range inspired by mathematical range syntax. For example, "[1.0,2.0)", "[1.0,)" or "[1.0]".
  • Field Details

    • lowerBound

      private final Version lowerBound
    • lowerBoundInclusive

      private final boolean lowerBoundInclusive
    • upperBound

      private final Version upperBound
    • upperBoundInclusive

      private final boolean upperBoundInclusive
  • Constructor Details

  • Method Details

    • getLowerBound

      public VersionRange.Bound getLowerBound()
      Description copied from interface: VersionRange
      Gets a lower bound (if any) for this range. If existent, this range does not contain any version smaller than its lower bound. Note that complex version ranges might exclude some versions even within their bounds.
      Specified by:
      getLowerBound in interface VersionRange
      Returns:
      A lower bound for this range or null is there is none.
    • getUpperBound

      public VersionRange.Bound getUpperBound()
      Description copied from interface: VersionRange
      Gets an upper bound (if any) for this range. If existent, this range does not contain any version greater than its upper bound. Note that complex version ranges might exclude some versions even within their bounds.
      Specified by:
      getUpperBound in interface VersionRange
      Returns:
      An upper bound for this range or null is there is none.
    • acceptsSnapshots

      public boolean acceptsSnapshots()
    • containsVersion

      public boolean containsVersion(Version version)
      Description copied from interface: VersionRange
      Determines whether the specified version is contained within this range.
      Specified by:
      containsVersion in interface VersionRange
      Parameters:
      version - The version to test, must not be null.
      Returns:
      true if this range contains the specified version, false otherwise.
    • isSnapshot

      private boolean isSnapshot(Version version)
    • equals

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

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

      private static int hash(Object obj)
    • toString

      public String toString()
      Overrides:
      toString in class Object