Interface DataTreeFactory
public interface DataTreeFactory
Factory interface for creating data trees.
-
Method Summary
Modifier and TypeMethodDescription@NonNull DataTreecreate(DataTreeConfiguration treeConfig) Create a new data tree based on specified configuration, with a best-guess root.@NonNull DataTreecreate(DataTreeConfiguration treeConfig, EffectiveModelContext initialSchemaContext) Create a new data tree based on specified configuration, with a root node derived from the schema context lookup of the configuration.@NonNull DataTreecreate(DataTreeConfiguration treeConfig, EffectiveModelContext initialSchemaContext, org.opendaylight.yangtools.yang.data.api.schema.DistinctNodeContainer<?, ?> initialRoot) Create a new data tree based on specified configuration, with the specified node.
-
Method Details
-
create
Create a new data tree based on specified configuration, with a best-guess root. Use this method only if you do not have a corresponding SchemaContext handy. Mandatory nodes whose enforcement point is the root node will not be enforced even if some are present in the SchemaContext and validation is requested in configuration.Correctness note: this method may not accurately initialize the root node in certain non-root scenarios due to the impossibility to accurately derive root type from plain YangInstanceIdentifier. Using
create(DataTreeConfiguration, EffectiveModelContext)is recommended, as it does not suffer from this shortcoming.- Parameters:
treeConfig- Tree configuration.- Returns:
- A data tree instance.
- Throws:
NullPointerException- if treeConfig is null
-
create
@NonNull DataTree create(DataTreeConfiguration treeConfig, EffectiveModelContext initialSchemaContext) Create a new data tree based on specified configuration, with a root node derived from the schema context lookup of the configuration. Mandatory nodes whose enforcement point is the root node will not be enforced even if some are present in the SchemaContext and validation is requested in configuration.- Parameters:
treeConfig- Tree configuration.- Returns:
- A data tree instance.
- Throws:
NullPointerException- if any of the arguments are nullIllegalArgumentException- if tree configuration does not match the SchemaContext, for example by root path referring to a node which does not exist in the SchemaContext
-
create
@NonNull DataTree create(DataTreeConfiguration treeConfig, EffectiveModelContext initialSchemaContext, org.opendaylight.yangtools.yang.data.api.schema.DistinctNodeContainer<?, ?> initialRoot) throws DataValidationFailedExceptionCreate a new data tree based on specified configuration, with the specified node.- Parameters:
treeConfig- Tree configuration.- Returns:
- A data tree instance.
- Throws:
DataValidationFailedException- if initial root is not valid according to the schema contextNullPointerException- if any of the arguments are nullIllegalArgumentException- if a mismatch between the arguments is detected
-