+ * @param namespace Module namespace, may be null
+ * @param revision Module revision, may be null
+ * @return Matching module or null if a match is not found
+ */
+ default Module findModuleByNamespaceAndRevision(final URI namespace, final Date revision) {
+ if (namespace == null) {
+ return null;
+ }
+ for (Module module : findModuleByNamespace(namespace)) {
+ if (revision == null || revision.equals(module.getRevision())) {
+ return module;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get yang source code represented as string for matching
+ * {@link org.opendaylight.yangtools.yang.model.api.ModuleIdentifier}.
+ *
+ * @param moduleIdentifier must provide a non-null
+ * {@link org.opendaylight.yangtools.yang.model.api.ModuleIdentifier#getName()}, other methods might return
+ * null.
+ * @return value iif matching module is found in schema context.