@Test public void testParsePlain() throws ParseException { SemanticVersion v = new SemanticVersion("1.2.3"); assertEquals(1, v.major); assertEquals(2, v.minor); assertEquals(3, v.patch); assertEquals("1.2.3", v.toString()); v = new SemanticVersion("11.22.33"); assertEquals(11, v.major); assertEquals(22, v.minor); assertEquals(33, v.patch); assertEquals("11.22.33", v.toString()); v = new SemanticVersion("11.22.33-SNAPSHOT"); assertEquals(11, v.major); assertEquals(22, v.minor); assertEquals(33, v.patch); assertEquals("SNAPSHOT", v.qualifier); assertEquals("11.22.33-SNAPSHOT", v.toString()); }
@Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); }
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); } }
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); } SemanticVersion();  SemanticVersion(int major, int minor, int patch);  SemanticVersion(int major, int minor, int patch, String qualifier);  SemanticVersion(String version); }
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); } SemanticVersion();  SemanticVersion(int major, int minor, int patch);  SemanticVersion(int major, int minor, int patch, String qualifier);  SemanticVersion(String version); boolean isUpdateFor(SemanticVersion v); boolean isSameOrNewer(SemanticVersion v); boolean isSame(SemanticVersion v); boolean isCompatibleUpdateFor(SemanticVersion v); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); @Override int compareTo(SemanticVersion v); String getAsString(); void setAsString(String version); }
SemanticVersion implements Comparable<SemanticVersion>, Serializable { @Override public String toString() { StringBuilder ret = new StringBuilder(); ret.append(major); ret.append('.'); ret.append(minor); ret.append('.'); ret.append(patch); if (qualifier != null) { ret.append('-'); ret.append(qualifier); } return ret.toString(); } SemanticVersion();  SemanticVersion(int major, int minor, int patch);  SemanticVersion(int major, int minor, int patch, String qualifier);  SemanticVersion(String version); boolean isUpdateFor(SemanticVersion v); boolean isSameOrNewer(SemanticVersion v); boolean isSame(SemanticVersion v); boolean isCompatibleUpdateFor(SemanticVersion v); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); @Override int compareTo(SemanticVersion v); String getAsString(); void setAsString(String version); public int major; public int minor; public int patch; public String qualifier; }