|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.ide.common.repository.GradleCoordinate
public class GradleCoordinate
This class represents a maven coordinate and allows for comparison at any level.
This class does not directly implement Comparable
; instead,
you should use one of the specific Comparator
constants based
on what type of ordering you need.
Nested Class Summary | |
---|---|
static class |
GradleCoordinate.ArtifactType
List taken from http://maven.apache.org/pom.html#Maven_Coordinates |
static class |
GradleCoordinate.ListComponent
A list of components separated by dashes. |
static class |
GradleCoordinate.NumberComponent
|
static class |
GradleCoordinate.PaddedNumberComponent
Like NumberComponent, but used for numeric strings that have leading zeroes which we must preserve |
static class |
GradleCoordinate.RevisionComponent
A single component of a revision number: either a number, a string or a list of components separated by dashes. |
static class |
GradleCoordinate.StringComponent
|
Field Summary | |
---|---|
static java.util.Comparator<GradleCoordinate> |
COMPARE_PLUS_HIGHER
Comparator which compares Gradle versions - and treats a + version as higher than a specific number. |
static java.util.Comparator<GradleCoordinate> |
COMPARE_PLUS_LOWER
Comparator which compares Gradle versions - and treats a + version as lower than a specific number in the same place. |
static com.android.ide.common.repository.GradleCoordinate.PlusComponent |
PLUS_REV
|
static int |
PLUS_REV_VALUE
|
static java.lang.String |
PREVIEW_ID
|
Constructor Summary | |
---|---|
GradleCoordinate(java.lang.String groupId,
java.lang.String artifactId,
GradleCoordinate.RevisionComponent... revisions)
Constructor |
|
GradleCoordinate(java.lang.String groupId,
java.lang.String artifactId,
int... revisions)
Constructor |
|
GradleCoordinate(java.lang.String groupId,
java.lang.String artifactId,
java.util.List<GradleCoordinate.RevisionComponent> revisions,
GradleCoordinate.ArtifactType type)
Constructor |
Method Summary | |
---|---|
boolean |
acceptsGreaterRevisions()
|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getArtifactId()
|
java.lang.String |
getFullRevision()
|
java.lang.String |
getGroupId()
|
java.lang.String |
getId()
|
int |
getMajorVersion()
Returns the major version (X in X.2.3), which can be PLUS_REV , or Integer.MIN_VALUE
if it is not available |
int |
getMicroVersion()
Returns the major version (X in 1.2.X), which can be PLUS_REV , or Integer.MIN_VALUE
if it is not available |
int |
getMinorVersion()
Returns the minor version (X in 1.X.3), which can be PLUS_REV , or Integer.MIN_VALUE
if it is not available |
GradleCoordinate.ArtifactType |
getType()
|
int |
hashCode()
|
boolean |
isPreview()
|
boolean |
isSameArtifact(GradleCoordinate o)
Returns true if and only if the given coordinate refers to the same group and artifact. |
static GradleCoordinate |
parseCoordinateString(java.lang.String coordinateString)
Create a GradleCoordinate from a string of the form groupId:artifactId:MajorRevision.MinorRevision.(MicroRevision|+) |
static java.util.List<GradleCoordinate.RevisionComponent> |
parseRevisionNumber(java.lang.String revision)
|
static GradleCoordinate |
parseVersionOnly(java.lang.String revision)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PREVIEW_ID
public static final com.android.ide.common.repository.GradleCoordinate.PlusComponent PLUS_REV
public static final int PLUS_REV_VALUE
public static final java.util.Comparator<GradleCoordinate> COMPARE_PLUS_LOWER
public static final java.util.Comparator<GradleCoordinate> COMPARE_PLUS_HIGHER
Constructor Detail |
---|
public GradleCoordinate(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull GradleCoordinate.RevisionComponent... revisions)
public GradleCoordinate(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull int... revisions)
public GradleCoordinate(@NonNull java.lang.String groupId, @NonNull java.lang.String artifactId, @NonNull java.util.List<GradleCoordinate.RevisionComponent> revisions, @Nullable GradleCoordinate.ArtifactType type)
Method Detail |
---|
@Nullable public static GradleCoordinate parseCoordinateString(@NonNull java.lang.String coordinateString)
coordinateString
- the string to parse
public static GradleCoordinate parseVersionOnly(@NonNull java.lang.String revision)
public static java.util.List<GradleCoordinate.RevisionComponent> parseRevisionNumber(java.lang.String revision)
public java.lang.String toString()
toString
in class java.lang.Object
@Nullable public java.lang.String getGroupId()
@Nullable public java.lang.String getArtifactId()
@Nullable public java.lang.String getId()
@Nullable public GradleCoordinate.ArtifactType getType()
public boolean acceptsGreaterRevisions()
public java.lang.String getFullRevision()
public boolean isPreview()
public int getMajorVersion()
PLUS_REV
, or Integer.MIN_VALUE
if it is not available
public int getMinorVersion()
PLUS_REV
, or Integer.MIN_VALUE
if it is not available
public int getMicroVersion()
PLUS_REV
, or Integer.MIN_VALUE
if it is not available
public boolean isSameArtifact(@NonNull GradleCoordinate o)
o
- the coordinate to compare with
public boolean equals(@NonNull java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |