VersionedName implements Comparable<VersionedName> { public static VersionedName fromString(String vn) { return parseMaybe(vn, false).get(); } VersionedName(Bundle b);  VersionedName(String name, String v);  VersionedName(String name, @Nullable Version v); @Override String toString(); String toOsgiString(); boolean equals(String sn, String v); boolean equals(String sn, Version v); String getSymbolicName(); @Nullable Version getOsgiVersion(); @Nullable String getOsgiVersionString(); @Nullable String getVersionString(); @Deprecated /** @deprecated since 0.12.0 use {@link #getVersionString()} or {@link #getOsgiVersion()} */ Version getVersion(); @Override int hashCode(); @Override boolean equals(Object other); boolean equalsOsgi(Object other); static VersionedName toOsgiVersionedName(VersionedName vn); static VersionedName fromString(String vn); static Maybe<VersionedName> parseMaybe(String symbolicNameWithVersion, boolean versionRequired); @Override int compareTo(VersionedName other);  }
@Test public void testVersionedNameFromString() { VersionedName foo1 = new VersionedName("foo", "1.0"); Assert.assertEquals(foo1, VersionedName.fromString("foo:1.0")); Assert.assertEquals(foo1, TypeCoercerExtensible.newDefault().coerce("foo:1.0", VersionedName.class)); }
@Test public void testVersionedNameFromVersion() { VersionedName foo1 = new VersionedName("foo", new Version("1")); Assert.assertEquals(foo1, VersionedName.fromString("foo:1.0.0")); }
@Test public void testOrder() { assertOrder(VersionedNameComparator.INSTANCE, VersionedName.fromString("a:3"), VersionedName.fromString("a:1"), VersionedName.fromString("a:0"), VersionedName.fromString("a:1-SNAPSHOT"), VersionedName.fromString("a"), VersionedName.fromString("b:2"), null); }