public final class QName extends Object implements Immutable, Serializable, Comparable<QName>
getNamespace()
- the namespace assigned to the YANG module which
defined element, type, procedure or notification.getRevision()
- the revision of the YANG module which describes the
elementgetLocalName()
- the YANG schema identifier which were defined for this
node in the YANG moduleprefix
assigned, but prefix does not
affect equality and identity of two QNames and carry only information
which may be useful for serializers / deserializers.Constructor and Description |
---|
QName(URI namespace,
String localName)
QName Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(QName other) |
static QName |
create(QNameModule qnameModule,
String localName)
Creates new QName.
|
static QName |
create(QName base,
String localName) |
static QName |
create(String input) |
static QName |
create(String namespace,
String localName)
Creates new QName.
|
static QName |
create(String namespace,
String localName,
Date revision)
Creates new QName.
|
static QName |
create(String namespace,
String revision,
String localName)
Creates new QName.
|
static QName |
create(URI namespace,
Date revision,
String localName)
Creates new QName.
|
boolean |
equals(Object obj)
Compares the specified object with this list for equality.
|
static String |
formattedRevision(Date revision)
Formats
Date representing revision to format
YYYY-mm-dd
YANG Specification defines format for revision as
YYYY-mm-dd. |
String |
getFormattedRevision()
Return string representation of revision in format
YYYY-mm-dd
YANG Specification defines format for revision as
YYYY-mm-dd. |
String |
getLocalName()
Returns YANG schema identifier which were defined for this node in the
YANG module
|
QNameModule |
getModule()
Get the module component of the QName.
|
URI |
getNamespace()
Returns XMLNamespace assigned to the YANG module.
|
Date |
getRevision()
Returns revision of the YANG module if the module has defined revision,
otherwise returns
null |
int |
hashCode() |
QName |
intern()
Return an interned reference to a equivalent QName.
|
boolean |
isEqualWithoutRevision(QName other)
Compares this QName to other, without comparing revision.
|
static Date |
parseRevision(String formatedDate) |
String |
toString() |
QName |
withModule(QNameModule newModule)
Creates copy of this with revision and prefix unset.
|
QName |
withoutRevision()
Returns a QName with the same namespace and local name, but with no revision.
|
public QNameModule getModule()
public URI getNamespace()
public String getLocalName()
public Date getRevision()
null
null
public QName intern()
public boolean equals(Object obj)
QName
and its getLocalName()
, getNamespace()
and
getRevision()
are equals to same properties of this instance.public static QName create(QNameModule qnameModule, String localName)
qnameModule
- Namespace and revision enclosed as a QNameModulelocalName
- Local name part of QName. MUST NOT BE null.public static QName create(URI namespace, Date revision, String localName)
namespace
- Namespace of QName or null if namespace is undefined.revision
- Revision of namespace or null if revision is unspecified.localName
- Local name part of QName. MUST NOT BE null.public static QName create(String namespace, String localName, Date revision)
namespace
- Namespace of QName or null if namespace is undefined.revision
- Revision of namespace or null if revision is unspecified.localName
- Local name part of QName. MUST NOT BE null.public static QName create(String namespace, String revision, String localName)
namespace
- Namespace of QName, MUST NOT BE Null.revision
- Revision of namespace / YANG module. MUST NOT BE null, MUST BE
in format YYYY-mm-dd
.localName
- Local name part of QName. MUST NOT BE null.NullPointerException
- If any of parameters is null.IllegalArgumentException
- If namespace
is not valid URI or
revision
is not according to format
YYYY-mm-dd
.public static QName create(String namespace, String localName)
namespace
- Namespace of QName, MUST NOT BE Null.localName
- Local name part of QName. MUST NOT BE null.NullPointerException
- If any of parameters is null.IllegalArgumentException
- If namespace
is not valid URI.public String getFormattedRevision()
YYYY-mm-dd
YANG Specification defines format for revision
as
YYYY-mm-dd. This format for revision is reused accross multiple places
such as capabilities URI, YANG modules, etc.public QName withModule(@Nonnull QNameModule newModule)
newModule
- New QNameModule to usepublic QName withoutRevision()
public static String formattedRevision(Date revision)
Date
representing revision to format
YYYY-mm-dd
YANG Specification defines format for revision
as
YYYY-mm-dd. This format for revision is reused accross multiple places
such as capabilities URI, YANG modules, etc.revision
- Date object to format or nullpublic boolean isEqualWithoutRevision(QName other)
localName
(getLocalName()
) and namespace
(getNamespace()
).other
- Other QName. Must not be null.NullPointerException
- if other
is null.public int compareTo(@Nonnull QName other)
compareTo
in interface Comparable<QName>
Copyright © 2018 OpenDaylight. All rights reserved.