Package org.openehealth.ipf.commons.core
Class URN
- java.lang.Object
-
- org.openehealth.ipf.commons.core.URN
-
- All Implemented Interfaces:
Serializable
,Comparable<URN>
public final class URN extends Object implements Comparable<URN>, Serializable
URN abstraction, following the pattern of URI and URL classes. This is not meant as a generic URN representation as defined in RFC 2141, but limited to its uses in healthcare domain, specifically for encoding UUIDs and OIDs. Note that in URNs the namespace identifier is case-insensitive- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(URN urn)
static URN
create(String text)
boolean
equals(Object o)
String
getNamespaceId()
String
getNamespaceSpecificString()
int
hashCode()
boolean
isNamespace(String namespace)
static boolean
isURN(String text)
String
toString()
URI
toURI()
-
-
-
Field Detail
-
UUID
public static final String UUID
- See Also:
- Constant Field Values
-
OID
public static final String OID
- See Also:
- Constant Field Values
-
PIN
public static final String PIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
URN
public URN(String text) throws URISyntaxException
- Throws:
URISyntaxException
-
URN
public URN(URI uri)
-
URN
public URN(UUID uuid)
-
URN
public URN(Oid oid)
-
URN
public URN(String namespaceId, String namespaceSpecificString) throws URISyntaxException
- Throws:
URISyntaxException
-
-
Method Detail
-
create
public static URN create(String text) throws URISyntaxException
- Throws:
URISyntaxException
-
compareTo
public int compareTo(URN urn)
- Specified by:
compareTo
in interfaceComparable<URN>
-
isURN
public static boolean isURN(String text)
-
toURI
public URI toURI()
- Returns:
- a new URI object representing this URN
-
getNamespaceId
public String getNamespaceId()
- Returns:
- the namespace ID of the URN
-
isNamespace
public boolean isNamespace(String namespace)
-
getNamespaceSpecificString
public String getNamespaceSpecificString()
- Returns:
- namespace-specific string, i.e. an OID or UUID value
-
-