Package io.strimzi.api.annotations
Class VersionRange<Version extends Comparable<Version>>
java.lang.Object
io.strimzi.api.annotations.VersionRange<Version>
- Type Parameters:
Version- The type of the version. This class assumes that older versions are less than newer versions andComparable.compareTo(Object)is consistent withObject.equals(Object).
Represents a range over some comparable version type.
Ranges can:
- be Empty
- consist of a single version
- consist of an inclusive lower bound and no upper bound
- consist of inclusive lower and upper bounds
-
Method Summary
Modifier and TypeMethodDescriptionstatic <Version extends Comparable<Version>>
VersionRange<Version>all()Returns a VersionRange matching all versionsbooleanChecks when the version is part of the version rangestatic <Version extends Comparable<Version>>
VersionRange<Version>empty()Returns an empty version rangebooleaninthashCode()booleanintersects(VersionRange<Version> other) Checks whether two version ranges intersectbooleanisAll()Checks whether this version range matches all versionsbooleanisEmpty()Checks whether this version range is empty or notlower()Returns the lower boundary of the version rangetoString()upper()Returns the upper boundary of the version range
-
Method Details
-
empty
Returns an empty version range- Type Parameters:
Version- The type of version range.- Returns:
- The empty version range.
-
all
Returns a VersionRange matching all versions- Type Parameters:
Version- The type of version range.- Returns:
- VersionRange matching all versions
-
isEmpty
public boolean isEmpty()Checks whether this version range is empty or not- Returns:
- Returns true if this version range is empty. Returns false otherwise.
-
isAll
public boolean isAll()Checks whether this version range matches all versions- Returns:
- Returns true if this version range matches all versions. Returns false otherwise.
-
lower
Returns the lower boundary of the version range- Returns:
- The lower boundary of the range
-
upper
Returns the upper boundary of the version range- Returns:
- The upper boundary of the range
-
equals
-
hashCode
public int hashCode() -
contains
Checks when the version is part of the version range- Parameters:
apiVersion- API Version which should be checked whether it is in the range or not- Returns:
- True when the range contains the version. False otherwise
-
intersects
Checks whether two version ranges intersect- Parameters:
other- The version range which should be compared with this version range- Returns:
- Returns true if the version ranges intersect. Returns false otherwise.
-
toString
-