2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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.yangtools.yang.data.api.schema;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.Identifier;
12 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 * A piece of data normalized to a particular {@link EffectiveModelContext}. We are making a distinction between
16 * {@code data} and {@code metadata} attached to it. This interface captures the former, with two specializations:
17 * {@link NormalizedNode} and {@link NormalizedYangData}.
19 public interface NormalizedData {
21 * Return the contract governing this {@link NormalizedData} instance.
24 * This method should be specialized in intermediate contracts like {@link MapNode} and implemented as a default
25 * method by interfaces which form the contracts themselves, for example {@link ContainerNode}, {@link LeafNode}
28 * @return A class identifying the NormalizedData contract.
30 @NonNull Class<? extends NormalizedData> contract();
33 * Return the name of this data.
35 * @return Name of this data.
37 @NonNull Identifier name();
40 * Returns the body of this node. While the return value specifies {@link Object}, this method's return value has
41 * further semantics. The returned object must be a well-published contract, such as {@code String},
42 * {@code Collection<NormalizedNode>} or {@code DOMSource}.
44 * @return Returned value of this node.
46 @NonNull Object body();