BUG-4688: eliminate QName(Module).getFormattedRevision()
[yangtools.git] / yang / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / QName.java
index ce3c1f305cf5ddbbaae86f1c668ec8d33fe1a00d..5ff45e0ad7efd1e01460846a76e954c843da215c 100644 (file)
@@ -340,8 +340,9 @@ public final class QName implements Immutable, Serializable, Comparable<QName> {
         if (getNamespace() != null) {
             sb.append(QNAME_LEFT_PARENTHESIS).append(getNamespace());
 
-            if (getFormattedRevision() != null) {
-                sb.append(QNAME_REVISION_DELIMITER).append(getFormattedRevision());
+            final Optional<Revision> rev = getRevision();
+            if (rev.isPresent()) {
+                sb.append(QNAME_REVISION_DELIMITER).append(rev.get());
             }
             sb.append(QNAME_RIGHT_PARENTHESIS);
         }
@@ -349,21 +350,6 @@ public final class QName implements Immutable, Serializable, Comparable<QName> {
         return sb.toString();
     }
 
-    /**
-     * Return string representation of revision in format <code>YYYY-mm-dd</code>
-     *
-     * <p>
-     * YANG Specification defines format for <code>revision</code> as
-     * YYYY-mm-dd. This format for revision is reused accross multiple places
-     * such as capabilities URI, YANG modules, etc.
-     *
-     * @return String representation of revision or null, if revision is not
-     *         set.
-     */
-    public String getFormattedRevision() {
-        return module.getFormattedRevision();
-    }
-
     /**
      * Creates copy of this with revision and prefix unset.
      *