Bug 4662: Introduce a SemanticVersion concept - import processing
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Deviation.java
index 639e03ad006c3924c7890263ce8e2f92bf32c4c1..2a29cb83801a17f4d9ac340fe8fe1c415c697c3f 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
+import com.google.common.base.Preconditions;
 import java.util.List;
 
 /**
@@ -17,7 +18,7 @@ import java.util.List;
  * from a standard.
  * </p>
  */
-public interface Deviation extends YangNode {
+public interface Deviation {
 
     /**
      * Enum describing YANG deviation 'deviate' statement. It defines how the
@@ -25,7 +26,20 @@ public interface Deviation extends YangNode {
      * definition.
      */
     enum Deviate {
-        NOT_SUPPORTED, ADD, REPLACE, DELETE
+        NOT_SUPPORTED("not-supported"), ADD("add"), REPLACE("replace"), DELETE("delete");
+
+        private final String keyword;
+
+        Deviate(final String keyword) {
+            this.keyword = Preconditions.checkNotNull(keyword);
+        }
+
+        /**
+         * @return String that corresponds to the yang keyword.
+         */
+        public String getKeyword() {
+            return keyword;
+        }
     }
 
     /**