Bug 3866: Support for Restconf HTTP Patch
[netconf.git] / opendaylight / restconf / sal-rest-connector / src / main / java / org / opendaylight / netconf / sal / restconf / impl / PATCHContext.java
1 /*
2  * Copyright (c) 2015 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 import com.google.common.base.Preconditions;
12 import java.util.List;
13 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
14
15 public class PATCHContext {
16
17     private final InstanceIdentifierContext<? extends SchemaNode> context;
18     private final List<PATCHEntity> data;
19     private final String patchId;
20
21     public PATCHContext(final InstanceIdentifierContext<? extends SchemaNode> context,
22                         final List<PATCHEntity> data, final String patchId) {
23         this.context = Preconditions.checkNotNull(context);
24         this.data = Preconditions.checkNotNull(data);
25         this.patchId = Preconditions.checkNotNull(patchId);
26     }
27
28     public InstanceIdentifierContext<? extends SchemaNode> getInstanceIdentifierContext() {
29         return context;
30     }
31
32     public List<PATCHEntity> getData() {
33         return data;
34     }
35
36     public String getPatchId() {
37         return patchId;
38     }
39 }