public class ProtocolVersionRange
extends java.lang.Object
Range
to support multiple ranges. This class is used to
compare ProtocolVersion
objects.Modifier and Type | Method and Description |
---|---|
ProtocolVersionRange |
add(com.google.common.collect.Range<ProtocolVersion> range)
Adds a new range to this range.
|
static ProtocolVersionRange |
all()
Returns a range that contains all versions.
|
boolean |
contains(ProtocolVersion version)
Checks if the given version is included in this range.
|
boolean |
equals(java.lang.Object object) |
static ProtocolVersionRange |
fromString(java.lang.String str)
Parses a range from a string.
|
int |
hashCode() |
static ProtocolVersionRange |
of(java.util.List<com.google.common.collect.Range<ProtocolVersion>> ranges)
Returns a range that contains only the given version.
|
static ProtocolVersionRange |
of(ProtocolVersion min,
ProtocolVersion max)
Returns a range that contains only the given version.
|
static ProtocolVersionRange |
of(com.google.common.collect.Range<ProtocolVersion> range)
Returns a range that contains only the given version.
|
java.lang.String |
toString() |
public static ProtocolVersionRange all()
public static ProtocolVersionRange of(ProtocolVersion min, ProtocolVersion max)
min
- the versionmax
- the versionpublic static ProtocolVersionRange of(com.google.common.collect.Range<ProtocolVersion> range)
range
- the versionpublic static ProtocolVersionRange of(java.util.List<com.google.common.collect.Range<ProtocolVersion>> ranges)
ranges
- the versionpublic ProtocolVersionRange add(com.google.common.collect.Range<ProtocolVersion> range)
range
- the range to addpublic boolean contains(ProtocolVersion version)
version
- the versiontrue
if the version is includedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static ProtocolVersionRange fromString(java.lang.String str)
str
- the string