*/
package org.opendaylight.yangtools.yang.model.api;
+import java.util.Optional;
+
/**
* YANG statement <code>typedef</code> contains also substatements
* <ul>
* <li><code>units</code> - textual information about units associated with this
* type.</li>
* </ul>
- * This interface contains the methods for getting the values of the arguments
- * of substatements mentioned above.
+ * This interface contains the methods for getting the values of the arguments of substatements mentioned above.
+ * Furthermore {@link LeafSchemaNode} and {@link LeafListSchemaNode} interfaces contribute to their internal type
+ * definitions.
*
* @param <T>
* type of the base type (YANG <code>type</code> substatement) which
*/
public interface TypeDefinition<T extends TypeDefinition<?>> extends SchemaNode {
/**
- * Returns the base type from which this type is derived. If this is yang
- * built-in type, returns null.
+ * Returns the base type from which this type is derived. If this is yang built-in type, returns null.
*
* @return value of <code><T></code> type which represents the base
* type of instance of the <code>TypeDefinition</code> type or null,
T getBaseType();
/**
- * Returns the unit which represents the value of the argument of the
- * <code>units</code> substatement of the YANG <code>typedef</code>
- * statement.
+ * Returns the unit which represents the value of the argument of the <code>units</code> substatement of the YANG
+ * <code>typedef</code>, <code>leaf</code> or <code>leaf-list</code> statements.
*
* @return string with units in which is type measured
*/
- String getUnits();
+ Optional<String> getUnits();
/**
- * Returns the default value which represents the value of the argument of
- * the <code>default</code> substatement of the YANG <code>typedef</code>
- * statement.
+ * Returns the default value which represents the value of the argument of the <code>default</code> substatement
+ * of the YANG <code>typedef</code> or <code>leaf</code> statement.
*
- * @return instance of <code>Object</code> type which contains default value
- * for <code>typedef</code>
+ * @return instance of <code>Object</code> type which contains default value for <code>typedef</code>
*/
- Object getDefaultValue();
+ Optional<? extends Object> getDefaultValue();
}