public class VersionedName extends java.lang.Object implements java.lang.Comparable<VersionedName>
Modifier and Type | Class and Description |
---|---|
static class |
VersionedName.VersionedNameComparator
Comparator which puts a:3 < a:1 < b:2 < null
|
static class |
VersionedName.VersionedNameStringComparator
Comparator which puts a:3 < a:1 < b:2 < null
|
Constructor and Description |
---|
VersionedName(org.osgi.framework.Bundle b) |
VersionedName(java.lang.String name,
java.lang.String v) |
VersionedName(java.lang.String name,
org.osgi.framework.Version v) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(VersionedName other) |
boolean |
equals(java.lang.Object other) |
boolean |
equals(java.lang.String sn,
java.lang.String v) |
boolean |
equals(java.lang.String sn,
org.osgi.framework.Version v) |
boolean |
equalsOsgi(java.lang.Object other)
As
equals(Object) but accepting the argument as equal
if versions are identical under the getOsgiVersion() conversion;
also accepts strings as the other, converting as per fromString(String) |
static VersionedName |
fromString(java.lang.String vn)
As
#parseMaybe(String) but throwing if invalid; allows null version |
org.osgi.framework.Version |
getOsgiVersion() |
java.lang.String |
getOsgiVersionString() |
java.lang.String |
getSymbolicName() |
org.osgi.framework.Version |
getVersion()
Deprecated.
|
java.lang.String |
getVersionString() |
int |
hashCode() |
static Maybe<VersionedName> |
parseMaybe(java.lang.String symbolicNameWithVersion,
boolean versionRequired)
Takes a string which might be of the form "symbolic-name" or "symbolic-name:version" (or something else entirely)
and returns a VersionedName.
|
java.lang.String |
toOsgiString() |
static VersionedName |
toOsgiVersionedName(VersionedName vn)
Returns a
VersionedName instance where getVersionString() complies with OSGi syntax (or is null),
even if the input does not. |
java.lang.String |
toString() |
public VersionedName(org.osgi.framework.Bundle b)
public VersionedName(java.lang.String name, java.lang.String v)
public VersionedName(java.lang.String name, @Nullable org.osgi.framework.Version v)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toOsgiString()
public boolean equals(java.lang.String sn, java.lang.String v)
public boolean equals(java.lang.String sn, org.osgi.framework.Version v)
public java.lang.String getSymbolicName()
@Nullable public org.osgi.framework.Version getOsgiVersion()
@Nullable public java.lang.String getOsgiVersionString()
@Nullable public java.lang.String getVersionString()
@Deprecated public org.osgi.framework.Version getVersion()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean equalsOsgi(java.lang.Object other)
equals(Object)
but accepting the argument as equal
if versions are identical under the getOsgiVersion()
conversion;
also accepts strings as the other, converting as per fromString(String)
public static VersionedName toOsgiVersionedName(VersionedName vn)
VersionedName
instance where getVersionString()
complies with OSGi syntax (or is null),
even if the input does not.
Typically used to convert from Brooklyn-recommended 1.0-SNAPSHOT
syntax to
OSGi-mandated 1.0.0.SNAPSHOT
syntax.public static VersionedName fromString(java.lang.String vn)
#parseMaybe(String)
but throwing if invalid; allows null versionpublic static Maybe<VersionedName> parseMaybe(java.lang.String symbolicNameWithVersion, boolean versionRequired)
Maybe.absent()
with a suitable message if not valid.public int compareTo(VersionedName other)
compareTo
in interface java.lang.Comparable<VersionedName>