*/
package org.opendaylight.yangtools.yang.model.api;
+import com.google.common.collect.ImmutableList;
+import java.util.List;
+import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
+
/**
- *
* Node which can have documentation assigned.
- *
*/
public interface DocumentedNode {
-
/**
- * Returns description of the instance of the type <code>SchemaNode</code>
+ * Returns the value of the argument of YANG <code>description</code> keyword.
*
- * @return string with textual description the node which represents the
- * argument of the YANG <code>description</code> substatement
+ * @return string with the description, or empty if description was not provided.
*/
- String getDescription();
+ Optional<String> getDescription();
/**
- * Returns reference of the instance of the type <code>SchemaNode</code>
- *
- * The reference refers to external document that provides additional
- * information relevant for the instance of this type.
+ * Returns the value of the argument of YANG <code>reference</code> keyword.
*
- * @return string with the reference to some external document which
- * represents the argument of the YANG <code>reference</code>
- * substatement
+ * @return string with reference to some other document, or empty if reference was not provided.
*/
- String getReference();
+ Optional<String> getReference();
/**
- * Returns status of the instance of the type <code>SchemaNode</code>
+ * Returns unknown schema nodes which belongs to this instance. Default implementation returns an empty list.
*
- * @return status of this node which represents the argument of the YANG
- * <code>status</code> substatement
+ * @return list of unknown schema nodes defined under this node.
*/
- Status getStatus();
+ default @NonNull List<UnknownSchemaNode> getUnknownSchemaNodes() {
+ return ImmutableList.of();
+ }
+
+ interface WithStatus extends DocumentedNode {
+ /**
+ * Returns status of the instance of the type <code>SchemaNode</code>.
+ *
+ * @return status of this node which represents the argument of the YANG
+ * <code>status</code> substatement
+ */
+ @NonNull Status getStatus();
+ }
}