public class VersionRange
extends java.lang.Object
A browser filter which matches when a browser falls into a version range. Versions are
expected to match the semantics of DelimitedVersion.
| Modifier and Type | Field and Description |
|---|---|
static VersionRange |
ANY_VERSION
A version range that matches any delimited version.
|
| Constructor and Description |
|---|
VersionRange(DelimitedVersion lowerBound,
DelimitedVersion upperBound)
Creates a version range with the specified bounds.
|
| Modifier and Type | Method and Description |
|---|---|
static VersionRange |
atLeast(DelimitedVersion version)
Creates a version range that will match any version at or above the specified version.
|
static VersionRange |
atLeast(java.lang.String version)
Creates a version range that will match any version at or above the specified version,
which will be parsed as a
DelimitedVersion. |
static VersionRange |
atMost(DelimitedVersion version)
Creates a version range that will match any version at or below the specified version.
|
static VersionRange |
atMost(java.lang.String version)
Creates a version range that will match any version at or below the specified version,
which will be parsed as a
DelimitedVersion. |
static VersionRange |
between(java.lang.String lowerBound,
java.lang.String upperBound)
Creates a version range that will match any version equal to or between the specified
versions, which will be parsed as
DelimitedVersion instances. |
boolean |
matches(DelimitedVersion version)
Determines whether the specified version falls within the version range.
|
boolean |
matches(java.lang.String version)
Determines whether the specified version (parsed as an
DelimitedVersion falls within
the version range. |
java.lang.String |
toString() |
public static final VersionRange ANY_VERSION
A version range that matches any delimited version.
public VersionRange(@Nullable
DelimitedVersion lowerBound,
@Nullable
DelimitedVersion upperBound)
Creates a version range with the specified bounds. A null bound is treated as “no bound” on that end.
public static VersionRange atLeast(java.lang.String version)
Creates a version range that will match any version at or above the specified version,
which will be parsed as a DelimitedVersion.
public static VersionRange atLeast(DelimitedVersion version)
Creates a version range that will match any version at or above the specified version.
public static VersionRange atMost(java.lang.String version)
Creates a version range that will match any version at or below the specified version,
which will be parsed as a DelimitedVersion.
public static VersionRange atMost(DelimitedVersion version)
Creates a version range that will match any version at or below the specified version.
public static VersionRange between(java.lang.String lowerBound, java.lang.String upperBound)
Creates a version range that will match any version equal to or between the specified
versions, which will be parsed as DelimitedVersion instances.
public boolean matches(@NonNull
java.lang.String version)
Determines whether the specified version (parsed as an DelimitedVersion falls within
the version range.
public boolean matches(@NonNull
DelimitedVersion version)
Determines whether the specified version falls within the version range.
public java.lang.String toString()
toString in class java.lang.Object