Bug 6949 / Bug 6950 - Implementation of start-time and stop-time
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / netconf / sal / restconf / impl / PATCHEntity.java
index ae16edc9d46b63d244031d94c2c2103678c37cdd..b857c8f82e71b0ab699360a46c3ac5df509ec6c0 100644 (file)
@@ -19,6 +19,13 @@ public class PATCHEntity {
     private final YangInstanceIdentifier targetNode;
     private final NormalizedNode<?,?> node;
 
+    /**
+     * Constructor to create PATCHEntity for PATCH operations which require value leaf representing data to be present.
+     * @param editId Id of PATCH edit
+     * @param operation PATCH edit operation
+     * @param targetNode Target node for PATCH edit operation
+     * @param node Data defined by value leaf used by edit operation
+     */
     public PATCHEntity(final String editId, final String operation, final YangInstanceIdentifier targetNode, final
     NormalizedNode<?, ?> node) {
         this.editId = Preconditions.checkNotNull(editId);
@@ -27,6 +34,20 @@ public class PATCHEntity {
         this.node = Preconditions.checkNotNull(node);
     }
 
+    /**
+     * Constructor to create PATCHEntity for PATCH operations which do not allow value leaf representing data to be
+     * present. <code>node</code> is set to <code>null</code> meaning that data are not allowed for edit operation.
+     * @param editId Id of PATCH edit
+     * @param operation PATCH edit operation
+     * @param targetNode Target node for PATCH edit operation
+     */
+    public PATCHEntity(final String editId, final String operation, final YangInstanceIdentifier targetNode) {
+        this.editId = Preconditions.checkNotNull(editId);
+        this.operation = Preconditions.checkNotNull(operation);
+        this.targetNode = Preconditions.checkNotNull(targetNode);
+        this.node = null;
+    }
+
     public String getOperation() {
         return operation;
     }