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.restconf.common.context;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ImmutableMap;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
16 public class NormalizedNodeContext {
17 private final InstanceIdentifierContext<? extends SchemaNode> context;
18 private final ImmutableMap<String, Object> headers;
19 private final WriterParameters writerParameters;
20 private final NormalizedNode data;
22 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
23 final NormalizedNode data, final WriterParameters writerParameters,
24 final ImmutableMap<String, Object> headers) {
25 this.context = context;
27 this.writerParameters = writerParameters;
28 this.headers = requireNonNull(headers);
31 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
32 final NormalizedNode data, final WriterParameters writerParameters) {
33 this(context, data, writerParameters, ImmutableMap.of());
36 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
37 final NormalizedNode data) {
38 this(context, data, WriterParameters.EMPTY, ImmutableMap.of());
41 public NormalizedNodeContext(final InstanceIdentifierContext<? extends SchemaNode> context,
42 final NormalizedNode data, final ImmutableMap<String, Object> headers) {
43 this(context, data, WriterParameters.EMPTY, headers);
46 public InstanceIdentifierContext<? extends SchemaNode> getInstanceIdentifierContext() {
50 public NormalizedNode getData() {
54 public WriterParameters getWriterParameters() {
55 return writerParameters;
59 * Return headers of {@code NormalizedNodeContext}.
61 * @return map of headers
63 public ImmutableMap<String, Object> getNewHeaders() {