Populate data/ hierarchy
[yangtools.git] / model / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / DocumentedNode.java
1 /*
2  * Copyright (c) 2014 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 package org.opendaylight.yangtools.yang.model.api;
9
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNull;
14
15 /**
16  * Node which can have documentation assigned.
17  */
18 public interface DocumentedNode {
19     /**
20      * Returns the value of the argument of YANG <code>description</code> keyword.
21      *
22      * @return string with the description, or empty if description was not provided.
23      */
24     Optional<String> getDescription();
25
26     /**
27      * Returns the value of the argument of YANG <code>reference</code> keyword.
28      *
29      * @return string with reference to some other document, or empty if reference was not provided.
30      */
31     Optional<String> getReference();
32
33     /**
34      * Returns unknown schema nodes which belongs to this instance. Default implementation returns an empty collection.
35      *
36      * @return collection of unknown schema nodes defined under this node.
37      */
38     default @NonNull Collection<? extends @NonNull UnknownSchemaNode> getUnknownSchemaNodes() {
39         return ImmutableList.of();
40     }
41
42     interface WithStatus extends DocumentedNode {
43         /**
44          * Returns status of the instance of the type <code>SchemaNode</code>.
45          *
46          * @return status of this node which represents the argument of the YANG
47          *         <code>status</code> substatement
48          */
49         @NonNull Status getStatus();
50     }
51 }