Split Restconf implementations (draft02 and RFC) - base api
[netconf.git] / restconf / restconf-nb-bierman02 / 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.restconf.common.context.InstanceIdentifierContext;
14 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
15
16 public class PatchContext {
17
18     private final InstanceIdentifierContext<? extends SchemaNode> context;
19     private final List<PatchEntity> data;
20     private final String patchId;
21
22     public PatchContext(final InstanceIdentifierContext<? extends SchemaNode> context,
23                         final List<PatchEntity> data, final String patchId) {
24         this.context = Preconditions.checkNotNull(context);
25         this.data = Preconditions.checkNotNull(data);
26         this.patchId = Preconditions.checkNotNull(patchId);
27     }
28
29     public InstanceIdentifierContext<? extends SchemaNode> getInstanceIdentifierContext() {
30         return context;
31     }
32
33     public List<PatchEntity> getData() {
34         return data;
35     }
36
37     public String getPatchId() {
38         return patchId;
39     }
40 }