Improve Decimal64.toString() implementation
[yangtools.git] / common / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / ErrorTag.java
index 6380b97c3a06cbd7b32975aad84dba59bb56300e..90bce0263418e375e407280b5e4389ac88bb6fb7 100644 (file)
@@ -75,6 +75,12 @@ public final class ErrorTag implements Serializable {
      * {@code lock-denied} {@link ErrorTag}.
      */
     public static final ErrorTag LOCK_DENIED = new ErrorTag("lock-denied");
+    /**
+     * {@code unknown-element} {@link ErrorTag}. Covers mechanics specified in
+     * <a href="https://datatracker.ietf.org/doc/html/rfc6241#page-80">RFC6241, Appendix A, last item</a>. Note the
+     * specification expressly forbids reporting this tag for NETCONF clients older than {@code :base:1.1}.
+     */
+    public static final ErrorTag MALFORMED_MESSAGE = new ErrorTag("malformed-message");
     /**
      * {@code missing-attribute} {@link ErrorTag}.
      */
@@ -172,7 +178,7 @@ public final class ErrorTag implements Serializable {
 
     @Override
     public boolean equals(final @Nullable Object obj) {
-        return obj == this || obj instanceof ErrorTag && elementBody.equals(((ErrorTag) obj).elementBody);
+        return obj == this || obj instanceof ErrorTag other && elementBody.equals(other.elementBody);
     }
 
     @Override