Move NormalizedMetadataWriter to yang-data-api
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / NormalizedTuple.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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 package org.opendaylight.yangtools.yang.data.api.schema;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.concepts.Immutable;
14
15 /**
16  * A tuple of normalized {@link #data()}, with corresponding {@link #metadata()} and {@link #mountPoints()}. The three
17  * views are expected to be consistent in their addressing -- i.e. when traversing {@link #data()} tree,
18  * the corresponding metadata should be available through {@link NormalizedMetadata#getChildren()} and mount point
19  * attachments should be available through {@link NormalizedMountpoints#getChildren()}.
20  */
21 // FIXME: this interface could use a traversal utility which binds together the 'NormalizedNodeContainer' part and
22 //        the corresponding metadata and/or mount points. Most notably mount points are only defined for ContainerNode
23 //        and MapEntryNode.
24 @Beta
25 public interface NormalizedTuple extends Immutable {
26     /**
27      * Return the data portion of this tree.
28      *
29      * @return Data portion of this tree.
30      */
31     @NonNull NormalizedNode data();
32
33     /**
34      * Return the metadata portion of this tree. This portion is optional.
35      *
36      * @return Metadata portion of this tree.
37      */
38     @Nullable NormalizedMetadata metadata();
39
40     /**
41      * Return the mount point portion of this tree. This portion is optional.
42      *
43      * @return mount point portion of this tree.
44      */
45     @Nullable NormalizedMountpoints mountPoints();
46 }