2 * Copyright (c) 2014 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.yangtools.yang.model.api;
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import java.util.Optional;
13 import org.eclipse.jdt.annotation.NonNull;
16 * Node which can have documentation assigned.
18 public interface DocumentedNode {
20 * Returns the value of the argument of YANG <code>description</code> keyword.
22 * @return string with the description, or empty if description was not provided.
24 Optional<String> getDescription();
27 * Returns the value of the argument of YANG <code>reference</code> keyword.
29 * @return string with reference to some other document, or empty if reference was not provided.
31 Optional<String> getReference();
34 * Returns unknown schema nodes which belongs to this instance. Default implementation returns an empty collection.
36 * @return collection of unknown schema nodes defined under this node.
38 default @NonNull Collection<? extends @NonNull UnknownSchemaNode> getUnknownSchemaNodes() {
39 return ImmutableList.of();
42 interface WithStatus extends DocumentedNode {
44 * Returns status of the instance of the type <code>SchemaNode</code>.
46 * @return status of this node which represents the argument of the YANG
47 * <code>status</code> substatement
49 @NonNull Status getStatus();