Merge "Bug 9092: revert to org.json temporarily"
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / netconf / sal / restconf / impl / PatchEditOperation.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.netconf.sal.restconf.impl;
10
11 /**
12  * Each YANG patch edit specifies one edit operation on the target data
13  * node.  The set of operations is aligned with the NETCONF edit
14  * operations, but also includes some new operations.
15  *
16  */
17 public enum PatchEditOperation {
18     CREATE(true),  // post
19     DELETE(false), // delete
20     INSERT(true),  // post
21     MERGE(true),
22     MOVE(false),   // delete+post
23     REPLACE(true), // put
24     REMOVE(false); // delete
25
26     private final boolean withValue;
27
28     PatchEditOperation(final boolean withValue) {
29         this.withValue = withValue;
30     }
31
32     /**
33      * Not all patch operations support value node. Check if operation requires value or not.
34      *
35      * @return true if operation requires value, false otherwise
36      */
37     public boolean isWithValue() {
38         return withValue;
39     }
40 }