Class DataTreeConfiguration
java.lang.Object
org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration
- All Implemented Interfaces:
Immutable
DataTree configuration class.
TreeConfig supports currently the following options:
- treeType
- enable/disable unique indexes and unique constraint validation
- enable/disable mandatory nodes validation
TreeConfig can be easily extended in order to support further data tree configuration options, like following:
- enable/disable case exclusion validation
- enable/disable other indexes
- other schema aware validation options
This can be useful when strict validation is not required or useful for some reasons.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NonNull DataTreeConfiguration
Default configuration for a data tree storingconfig true
data nodes.static final @NonNull DataTreeConfiguration
Default configuration for a data tree storingconfig false
data nodes. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull DataTreeConfiguration.Builder
Returns a newDataTreeConfiguration.Builder
initialized for aTreeType
.@NonNull DataTreeConfiguration.Builder
Deprecated, for removal: This API element is subject to removal in a future version.boolean
static @NonNull DataTreeConfiguration
getDefault
(TreeType treeType) Returns the default configuration for aTreeType
.@NonNull YangInstanceIdentifier
Returns the path prefix from the conceptual YANG data store root to the root node of this data tree.@NonNull TreeType
Returns theTreeType
of this data tree.int
hashCode()
boolean
Returnstrue
if the presence of mandatory nodes should be enforced.boolean
Returnstrue
if writtenDataContainerNode
s should be recursively verified to not contain incorrect data.boolean
Returnstrue
ifunique
constraints should be enforced.boolean
Returnstrue
if requests to store additional versioning information should be honored.@NonNull DataTreeConfiguration.Builder
Returns a newDataTreeConfiguration.Builder
initialized to produce an equivalent configuration to this one.toString()
-
Field Details
-
DEFAULT_CONFIGURATION
Default configuration for a data tree storingconfig true
data nodes. It has the following characteristics:- mandatory node presence is enforced
unique
constraints are not enforced- version information is not tracked
- recursive validation of written structures is performed
-
DEFAULT_OPERATIONAL
Default configuration for a data tree storingconfig false
data nodes. It has the following characteristics:- mandatory node presence is enforced
unique
constraints are not enforced- version information is not tracked
- recursive validation of written structures is not performed
-
-
Method Details
-
getDefault
Returns the default configuration for aTreeType
.- Parameters:
treeType
- theTreeType
- Returns:
- the default configuration
-
builder
Returns a newDataTreeConfiguration.Builder
initialized for aTreeType
.- Parameters:
treeType
- theTreeType
- Returns:
- a new
DataTreeConfiguration.Builder
-
copyBuilder
@Deprecated(since="14.0.14", forRemoval=true) public @NonNull DataTreeConfiguration.Builder copyBuilder()Deprecated, for removal: This API element is subject to removal in a future version. -
toBuilder
Returns a newDataTreeConfiguration.Builder
initialized to produce an equivalent configuration to this one.- Returns:
- a new
DataTreeConfiguration.Builder
-
getRootPath
Returns the path prefix from the conceptual YANG data store root to the root node of this data tree. Empty indicates the data store root.- Returns:
- the path prefix
-
getTreeType
Returns theTreeType
of this data tree.- Returns:
- the
TreeType
-
isMandatoryNodesValidationEnabled
public boolean isMandatoryNodesValidationEnabled()Returnstrue
if the presence of mandatory nodes should be enforced. This option is expected to have a minor performance impact.- Returns:
true
if the presence of mandatory nodes should be enforced
-
isUniqueIndexEnabled
public boolean isUniqueIndexEnabled()Returnstrue
ifunique
constraints should be enforced. Reference implementation is known to not scale well with this option enabled.- Returns:
true
ifunique
constraints should be enforced
-
isVersionInfoTrackingEnabled
public boolean isVersionInfoTrackingEnabled()Returnstrue
if requests to store additional versioning information should be honored. This option is expected to have increase heap metadata usage by 0 (typical JVM configuration) to 50%. This does not includes the overhead of actually stored data, as that is controlled by the user.- Returns:
true
if requests to store additional versioning information should be honored
-
isRecursiveWriteValidationEnabled
public boolean isRecursiveWriteValidationEnabled()Returnstrue
if writtenDataContainerNode
s should be recursively verified to not contain incorrect data. This option can have significant impact on CPU usage, depending on access patterns.- Returns:
true
if writtenDataContainerNode
s should be recursively verified
-
hashCode
public int hashCode() -
equals
-
toString
-