Package org.eclipse.aether.util.version
Class UnionVersionRange
- java.lang.Object
-
- org.eclipse.aether.util.version.UnionVersionRange
-
- All Implemented Interfaces:
VersionRange
final class UnionVersionRange extends java.lang.Object implements VersionRange
A union of version ranges.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.aether.version.VersionRange
VersionRange.Bound
-
-
Field Summary
Fields Modifier and Type Field Description private VersionRange.BoundlowerBoundprivate java.util.Set<VersionRange>rangesprivate VersionRange.BoundupperBound
-
Constructor Summary
Constructors Modifier Constructor Description privateUnionVersionRange(java.util.Collection<? extends VersionRange> ranges)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsVersion(Version version)Determines whether the specified version is contained within this range.booleanequals(java.lang.Object obj)static VersionRangefrom(java.util.Collection<? extends VersionRange> ranges)static VersionRangefrom(VersionRange... ranges)VersionRange.BoundgetLowerBound()Gets a lower bound (if any) for this range.VersionRange.BoundgetUpperBound()Gets an upper bound (if any) for this range.inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
ranges
private final java.util.Set<VersionRange> ranges
-
lowerBound
private final VersionRange.Bound lowerBound
-
upperBound
private final VersionRange.Bound upperBound
-
-
Constructor Detail
-
UnionVersionRange
private UnionVersionRange(java.util.Collection<? extends VersionRange> ranges)
-
-
Method Detail
-
from
public static VersionRange from(VersionRange... ranges)
-
from
public static VersionRange from(java.util.Collection<? extends VersionRange> ranges)
-
containsVersion
public boolean containsVersion(Version version)
Description copied from interface:VersionRangeDetermines whether the specified version is contained within this range.- Specified by:
containsVersionin interfaceVersionRange- Parameters:
version- The version to test, must not benull.- Returns:
trueif this range contains the specified version,falseotherwise.
-
getLowerBound
public VersionRange.Bound getLowerBound()
Description copied from interface:VersionRangeGets 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:
getLowerBoundin interfaceVersionRange- Returns:
- A lower bound for this range or
nullis there is none.
-
getUpperBound
public VersionRange.Bound getUpperBound()
Description copied from interface:VersionRangeGets 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:
getUpperBoundin interfaceVersionRange- Returns:
- An upper bound for this range or
nullis there is none.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-