GradleCoordinate { public static GradleCoordinate parseVersionOnly(@NonNull String revision) { return new GradleCoordinate(NONE, NONE, parseRevisionNumber(revision), null); } GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull RevisionComponent... revisions);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull String revision);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull int... revisions);  GradleCoordinate(@NonNull String groupId, @NonNull String artifactId,
            @NonNull List<RevisionComponent> revisions, @Nullable ArtifactType type); @Nullable static GradleCoordinate parseCoordinateString(@NonNull String coordinateString); static GradleCoordinate parseVersionOnly(@NonNull String revision); @NonNull static List<RevisionComponent> parseRevisionNumber(@NonNull String revision); @Override String toString(); @Nullable String getGroupId(); @Nullable String getArtifactId(); @Nullable ArtifactType getArtifactType(); @Nullable String getId(); @Nullable ArtifactType getType(); boolean acceptsGreaterRevisions(); @NonNull String getRevision(); boolean isPreview(); int getMajorVersion(); int getMinorVersion(); int getMicroVersion(); boolean isSameArtifact(@NonNull GradleCoordinate o); boolean matches(@NonNull GradleCoordinate pattern); @Override boolean equals(@NonNull Object o); @Override int hashCode(); static final String PREVIEW_ID; static final PlusComponent PLUS_REV; static final int PLUS_REV_VALUE; static final Comparator<GradleCoordinate> COMPARE_PLUS_LOWER; static final Comparator<GradleCoordinate> COMPARE_PLUS_HIGHER; }
@Test public void testParseVersionOnly() { String revision = "15.32.64"; GradleCoordinate a = GradleCoordinate.parseVersionOnly(revision); assertEquals(revision, a.getRevision()); String revisionB = "16.12.0-rc1"; GradleCoordinate b = GradleCoordinate.parseVersionOnly(revisionB); assertEquals(revisionB, b.getRevision()); assertTrue(b.isPreview()); }