Bug 808: Added representation for unordered and ordered lists.
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / ModifyAction.java
index b4eeb763817d829a7974563054230d68d673e8ba..dd987e127a4bc629844cc0022425a644f90d8ee3 100644 (file)
@@ -1,51 +1,51 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.yangtools.yang.data.api;\r
-\r
-import java.util.Arrays;\r
-\r
-// TODO rename to ModifyOperation\r
-\r
-/**\r
- * http://tools.ietf.org/html/rfc6241#section-7.2\r
- */\r
-public enum ModifyAction {\r
-    MERGE, REPLACE, CREATE, DELETE, REMOVE, NONE;\r
-\r
-    public static ModifyAction fromXmlValue(String xmlNameOfAction) {\r
-        switch (xmlNameOfAction) {\r
-        case "merge":\r
-            return MERGE;\r
-        case "replace":\r
-            return REPLACE;\r
-        case "remove":\r
-            return REMOVE;\r
-        case "delete":\r
-            return DELETE;\r
-        case "create":\r
-            return CREATE;\r
-        case "none":\r
-            return NONE;\r
-        default:\r
-            throw new IllegalArgumentException("Unknown operation " + xmlNameOfAction + " available operations "\r
-                    + Arrays.toString(ModifyAction.values()));\r
-        }\r
-    }\r
-\r
-    public boolean isAsDefaultPermitted() {\r
-        boolean isPermitted = this == MERGE;\r
-        isPermitted |= this == REPLACE;\r
-        isPermitted |= this == NONE;\r
-        return isPermitted;\r
-    }\r
-\r
-    public boolean isOnElementPermitted() {\r
-        return this != NONE;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.data.api;
+
+import java.util.Arrays;
+
+// TODO rename to ModifyOperation
+
+/**
+ * http://tools.ietf.org/html/rfc6241#section-7.2
+ */
+public enum ModifyAction {
+    MERGE, REPLACE, CREATE, DELETE, REMOVE, NONE;
+
+    public static ModifyAction fromXmlValue(String xmlNameOfAction) {
+        switch (xmlNameOfAction) {
+        case "merge":
+            return MERGE;
+        case "replace":
+            return REPLACE;
+        case "remove":
+            return REMOVE;
+        case "delete":
+            return DELETE;
+        case "create":
+            return CREATE;
+        case "none":
+            return NONE;
+        default:
+            throw new IllegalArgumentException("Unknown operation " + xmlNameOfAction + " available operations "
+                    + Arrays.toString(ModifyAction.values()));
+        }
+    }
+
+    public boolean isAsDefaultPermitted() {
+        boolean isPermitted = this == MERGE;
+        isPermitted |= this == REPLACE;
+        isPermitted |= this == NONE;
+        return isPermitted;
+    }
+
+    public boolean isOnElementPermitted() {
+        return this != NONE;
+    }
+
+}