public class GradleVersionRange
extends java.lang.Object
e.g. a library has a dependency on androidx.core:core:1.5.7 it means that any library in the range [1.5.7, 2.0.0) would work as a dependency because androidx libraries guarantees semantic versioning.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
GradleVersion |
getMax()
The upper bound (exclusive)
|
GradleVersion |
getMin()
The lower bound (inclusive)
|
int |
hashCode() |
GradleVersionRange |
intersection(GradleVersion version) |
GradleVersionRange |
intersection(GradleVersionRange other) |
static GradleVersionRange |
parse(java.lang.String value)
Parses the given version range.
|
static GradleVersionRange |
parse(java.lang.String value,
com.android.ide.common.repository.KnownVersionStability stability)
Parses the given version range.
|
java.lang.String |
toString() |
static GradleVersionRange |
tryParse(java.lang.String value)
Parses the given version.
|
static GradleVersionRange |
tryParse(java.lang.String value,
com.android.ide.common.repository.KnownVersionStability stability)
Parses the given version.
|
@NonNull public static GradleVersionRange parse(@NonNull java.lang.String value)
value - the version range to parse example: [2.3.4,3.0.0)Version object.java.lang.IllegalArgumentException - if the given value does not conform with any of the
supported version formats.@NonNull public static GradleVersionRange parse(@NonNull java.lang.String value, @NonNull com.android.ide.common.repository.KnownVersionStability stability)
value - the version range to parse.stability - the stability of the artifact.Version object.java.lang.IllegalArgumentException - if the given value does not conform with any of the
supported version formats.@Nullable public static GradleVersionRange tryParse(@NonNull java.lang.String value, @NonNull com.android.ide.common.repository.KnownVersionStability stability)
parse(String), but it does
not throw exceptions if the given value does not conform with any of the supported version
formats.value - the version to parse.stability - the stability of the artifact.GradleVersionRange object, or null if the given value
does not conform with any of the supported version formats.@Nullable public static GradleVersionRange tryParse(@NonNull java.lang.String value)
parse(String), but it does
not throw exceptions if the given value does not conform with any of the supported version
formats.value - the version to parse.GradleVersionRange object, or null if the given value
does not conform with any of the supported version formats.@NonNull public GradleVersion getMin()
@Nullable public GradleVersion getMax()
@Nullable public GradleVersionRange intersection(@NonNull GradleVersionRange other)
@Nullable public GradleVersionRange intersection(@NonNull GradleVersion version)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object