Class QNameModule
java.lang.Object
org.opendaylight.yangtools.yang.common.QNameModule
- All Implemented Interfaces:
Serializable
,Comparable<QNameModule>
,Identifier
,Immutable
,WritableObject
public final class QNameModule
extends Object
implements Comparable<QNameModule>, Immutable, Serializable, Identifier, WritableObject
A
XMLNamespace
bound to a particular model Revision
. This is the primary way of identifying a YANG
module namespace within an effective model world. The reason for this is that we support coexistence of multiple
module revisions and hence cannot use plain module name or namespace to address them.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
static @NonNull QNameModule
create
(XMLNamespace namespace) Create a new QName module instance with specified namespace and no revision.static @NonNull QNameModule
create
(XMLNamespace namespace, @Nullable Revision revision) Create a new QName module instance with specified namespace/revision.static @NonNull QNameModule
create
(XMLNamespace namespace, Optional<Revision> revision) Create a new QName module instance with specified namespace/revision.boolean
@NonNull XMLNamespace
Returns the namespace of the module which is specified as argument of YANG Modulenamespace
keyword.Returns the revision date for the module.int
hashCode()
@NonNull QNameModule
intern()
Return an interned reference to a equivalent QNameModule.static @NonNull QNameModule
Read a QNameModule from a DataInput.@NonNull String
toString()
@NonNull QNameModule
Returns a QNameModule with the same namespace, but with no revision.void
writeTo
(DataOutput out) Serialize this object into aDataOutput
as a fixed-format stream.
-
Method Details
-
intern
Return an interned reference to a equivalent QNameModule.- Returns:
- Interned reference, or this object if it was interned.
-
create
Create a new QName module instance with specified namespace/revision.- Parameters:
namespace
- Module namespacerevision
- Module revision- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException
- if any argument is null
-
create
Create a new QName module instance with specified namespace and no revision.- Parameters:
namespace
- Module namespace- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException
- ifnamespace
is null
-
create
Create a new QName module instance with specified namespace/revision.- Parameters:
namespace
- Module namespacerevision
- Module revision- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException
- if any argument is null
-
readFrom
Read a QNameModule from a DataInput. The format is expected to match the output format ofwriteTo(DataOutput)
.- Parameters:
in
- DataInput to read- Returns:
- A QNameModule instance
- Throws:
IOException
- if I/O error occurs
-
getNamespace
Returns the namespace of the module which is specified as argument of YANG Modulenamespace
keyword.- Returns:
- XMLNamespace of the namespace of the module
-
getRevision
Returns the revision date for the module.- Returns:
- date of the module revision which is specified as argument of YANG Module
revision
keyword
-
compareTo
- Specified by:
compareTo
in interfaceComparable<QNameModule>
-
withoutRevision
Returns a QNameModule with the same namespace, but with no revision. If this QNameModule does not have a revision, this object is returned.- Returns:
- a QNameModule with the same namespace, but with no revision.
-
writeTo
Description copied from interface:WritableObject
Serialize this object into aDataOutput
as a fixed-format stream.- Specified by:
writeTo
in interfaceWritableObject
- Parameters:
out
- Data output- Throws:
IOException
- if an I/O error occurs
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceIdentifier
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceIdentifier
- Overrides:
equals
in classObject
-
toString
- Specified by:
toString
in interfaceIdentifier
- Overrides:
toString
in classObject
-