2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netconf.sal.restconf.impl;
10 import java.util.HashMap;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
15 public class NormalizedNodeContext {
17 private final InstanceIdentifierContext<? extends SchemaNode> context;
18 private final NormalizedNode<?,?> data;
19 private final WriterParameters writerParameters;
20 private Map<String, Object> headers = new HashMap<>();
22 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
23 final NormalizedNode<?, ?> data, final WriterParameters writerParameters) {
24 this.context = context;
26 this.writerParameters = writerParameters;
29 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
30 final NormalizedNode<?, ?> data, final WriterParameters writerParameters,
31 final Map<String, Object> headers) {
32 this.context = context;
34 this.writerParameters = writerParameters;
35 this.headers = headers;
38 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
39 final NormalizedNode<?, ?> data) {
40 this.context = context;
42 // default writer parameters
43 this.writerParameters = new WriterParameters.WriterParametersBuilder().build();
46 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
47 final NormalizedNode<?, ?> data, final Map<String, Object> headers) {
48 this.context = context;
50 // default writer parameters
51 this.writerParameters = new WriterParameters.WriterParametersBuilder().build();
52 this.headers = headers;
56 public InstanceIdentifierContext<? extends SchemaNode> getInstanceIdentifierContext() {
60 public NormalizedNode<?, ?> getData() {
64 public WriterParameters getWriterParameters() {
65 return this.writerParameters;
69 * Return headers of {@code NormalizedNodeContext}.
71 * @return map of headers
73 public Map<String, Object> getNewHeaders() {