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 TypeMethodDescriptionintstatic @NonNull QNameModulecreate(XMLNamespace namespace) Deprecated, for removal: This API element is subject to removal in a future version.static @NonNull QNameModulecreate(XMLNamespace namespace, @Nullable Revision revision) Deprecated, for removal: This API element is subject to removal in a future version.UseofRevision(XMLNamespace, Revision)insteadstatic @NonNull QNameModulecreate(XMLNamespace namespace, Optional<Revision> revision) Deprecated, for removal: This API element is subject to removal in a future version.UseofRevision(XMLNamespace, Revision)insteadbooleanReturns the revision date for the module.@NonNull XMLNamespaceDeprecated, for removal: This API element is subject to removal in a future version.Usenamespace()instead.Deprecated, for removal: This API element is subject to removal in a future version.UsefindRevision()orrevision()instead.inthashCode()@NonNull QNameModuleintern()Return an interned reference to a equivalent QNameModule.@NonNull XMLNamespaceReturns the namespace of the module which is specified as argument of YANG Modulenamespacekeyword.static @NonNull QNameModuleCreate a new QName module instance with specified namespace string and no revision.static @NonNull QNameModuleCreate a new QName module instance with specified namespace string andRevisionUnionstring.static @NonNull QNameModuleof(XMLNamespace namespace) Create a new QName module instance with specifiedXMLNamespaceand no revision.static @NonNull QNameModuleof(XMLNamespace namespace, Revision revision) Create a new QName module instance with specifiedXMLNamespaceandRevision.static @NonNull QNameModuleof(XMLNamespace namespace, RevisionUnion revUnion) Create a new QName module instance with specifiedXMLNamespaceandRevisionUnion.static @NonNull QNameModuleofRevision(String namespace, @Nullable String revision) Create a new QName module instance with specifiedXMLNamespaceand an optionalRevision.static @NonNull QNameModuleofRevision(XMLNamespace namespace, @Nullable Revision revision) Create a new QName module instance with specifiedXMLNamespaceand an optionalRevision.static @NonNull QNameModuleRead a QNameModule from a DataInput.@Nullable Revisionrevision()Returns the revision date for the module.@NonNull RevisionUnionReturns the revision date for the module.@NonNull StringtoString()@NonNull QNameModuleReturns a QNameModule with the same namespace, but with no revision.voidwriteTo(DataOutput out)
-
Method Details
-
of
Create a new QName module instance with specifiedXMLNamespaceand no revision.- Parameters:
namespace- Module namespace- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
of
Create a new QName module instance with specifiedXMLNamespaceandRevisionUnion.- Parameters:
namespace- Module namespacerevUnion- Module revision union- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
of
Create a new QName module instance with specifiedXMLNamespaceandRevision.- Parameters:
namespace- Module namespacerevision- Module revision- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
of
Create a new QName module instance with specified namespace string and no revision.- Parameters:
namespace- Module namespace- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
of
Create a new QName module instance with specified namespace string andRevisionUnionstring.- Parameters:
namespace- Module namespaceunionString- Module revision string or an empty string- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
ofRevision
Create a new QName module instance with specifiedXMLNamespaceand an optionalRevision.- Parameters:
namespace- Module namespacerevision- Module revision- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- if any argument isnull
-
ofRevision
Create a new QName module instance with specifiedXMLNamespaceand an optionalRevision.- Parameters:
namespace- Module namespacerevision- Module revision string- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- ifnamespaceisnull
-
create
@Deprecated(since="13.0.1", forRemoval=true) public static @NonNull QNameModule create(XMLNamespace namespace, Optional<Revision> revision) Deprecated, for removal: This API element is subject to removal in a future version.UseofRevision(XMLNamespace, Revision)insteadCreate 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 isnull
-
create
@Deprecated(since="13.0.1", forRemoval=true) public static @NonNull QNameModule create(XMLNamespace namespace) Deprecated, for removal: This API element is subject to removal in a future version.Useof(XMLNamespace)insteadCreate a new QName module instance with specified namespace and no revision.- Parameters:
namespace- Module namespace- Returns:
- A new, potentially shared, QNameModule instance
- Throws:
NullPointerException- ifnamespaceis null
-
create
@Deprecated(since="13.0.1", forRemoval=true) public static @NonNull QNameModule create(XMLNamespace namespace, @Nullable Revision revision) Deprecated, for removal: This API element is subject to removal in a future version.UseofRevision(XMLNamespace, Revision)insteadCreate 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 isnull
-
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
-
namespace
Returns the namespace of the module which is specified as argument of YANG Modulenamespacekeyword.- Returns:
- XMLNamespace of the namespace of the module
-
getNamespace
Deprecated, for removal: This API element is subject to removal in a future version.Usenamespace()instead.Returns the namespace of the module which is specified as argument of YANG Modulenamespacekeyword.- Returns:
- XMLNamespace of the namespace of the module
-
revisionUnion
Returns the revision date for the module.- Returns:
- date of the module revision which is specified as argument of YANG Module
revisionkeyword
-
revision
Returns the revision date for the module.- Returns:
- date of the module revision which is specified as argument of YANG Module
revisionkeyword
-
findRevision
Returns the revision date for the module.- Returns:
- date of the module revision which is specified as argument of YANG Module
revisionkeyword
-
getRevision
Deprecated, for removal: This API element is subject to removal in a future version.UsefindRevision()orrevision()instead.Returns the revision date for the module.- Returns:
- date of the module revision which is specified as argument of YANG Module
revisionkeyword
-
intern
Return an interned reference to a equivalent QNameModule.- Returns:
- Interned reference, or this object if it was interned.
-
compareTo
- Specified by:
compareToin 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
- Specified by:
writeToin interfaceWritableObject- Throws:
IOException
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceIdentifier- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceIdentifier- Overrides:
equalsin classObject
-
toString
- Specified by:
toStringin interfaceIdentifier- Overrides:
toStringin classObject
-
of(XMLNamespace)instead