Interface DataTreeCandidateNode
public interface DataTreeCandidateNode
A single node within a
DataTreeCandidate. The nodes are organized in tree hierarchy, reflecting
the modification from which this candidate was created. The node itself exposes the before- and after-image
of the tree restricted to the modified nodes.-
Method Summary
Modifier and TypeMethodDescription@NonNull Collection<DataTreeCandidateNode>Get an unmodifiable collection of modified child nodes.@Nullable org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeReturn the after-image of data corresponding to the node.@Nullable org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeReturn the before-image of data corresponding to the node.default @NonNull Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode>Return the after-image of data corresponding to the node.default @NonNull Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode>Return the before-image of data corresponding to the node.default @NonNull Optional<DataTreeCandidateNode>findModifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty.default @NonNull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeReturn the after-image of data corresponding to the node.default @NonNull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeReturn the before-image of data corresponding to the node.default @NonNull DataTreeCandidateNodegetModifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty.@NonNull ModificationTypeReturn the type of modification this node is undergoing.@Nullable DataTreeCandidateNodemodifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty.@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgumentname()Get the node underlyingNormalizedNode.name().
-
Method Details
-
name
@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument name()Get the node underlyingNormalizedNode.name().- Returns:
- The node identifier.
-
childNodes
@NonNull Collection<DataTreeCandidateNode> childNodes()Get an unmodifiable collection of modified child nodes. Note that the collection may includeModificationType.UNMODIFIEDnodes, which the caller is expected to handle as if they were not present.- Returns:
- Unmodifiable collection of modified child nodes.
-
modifiedChild
@Nullable DataTreeCandidateNode modifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty. Note that this method may return anModificationType.UNMODIFIEDnode when there is evidence of the node or its parent being involved in modification which has turned out not to modify the node's contents.- Parameters:
childName- Identifier of child node- Returns:
- Modified child or
nullif the specified child has not been modified - Throws:
NullPointerException- ifchildNamezisnull
-
findModifiedChild
default @NonNull Optional<DataTreeCandidateNode> findModifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty. Note that this method may return anModificationType.UNMODIFIEDnode when there is evidence of the node or its parent being involved in modification which has turned out not to modify the node's contents.- Parameters:
childName- Identifier of child node- Returns:
- Modified child or empty.
- Throws:
NullPointerException- ifchildIdentifierisnull- Implementation Requirements:
- Default implementation defers to
Optional.ofNullable(Object)based onmodifiedChild(PathArgument).
-
getModifiedChild
default @NonNull DataTreeCandidateNode getModifiedChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument childName) Returns modified child or empty. Note that this method may return anModificationType.UNMODIFIEDnode when there is evidence of the node or its parent being involved in modification which has turned out not to modify the node's contents.- Parameters:
childName- Identifier of child node- Returns:
- Modified child
- Throws:
NullPointerException- ifchildNameisnullcom.google.common.base.VerifyException- if no modified child with specified name is found- Implementation Requirements:
- Default implementation defers to
modifiedChild(PathArgument).
-
modificationType
@NonNull ModificationType modificationType()Return the type of modification this node is undergoing.- Returns:
- Node modification type.
-
dataBefore
@Nullable org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode dataBefore()Return the before-image of data corresponding to the node.- Returns:
- Node data as they were present in the tree before the modification was applied.
-
findDataBefore
default @NonNull Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode> findDataBefore()Return the before-image of data corresponding to the node.- Returns:
- Node data as they were present in the tree before the modification was applied, or empty.
- Implementation Requirements:
- Default implementation defers to
Optional.ofNullable(Object)based ondataBefore().
-
getDataBefore
default @NonNull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode getDataBefore()Return the before-image of data corresponding to the node.- Returns:
- Node data as they were present in the tree before the modification was applied.
- Throws:
com.google.common.base.VerifyException- if no before-image is present- Implementation Requirements:
- Default implementation defers to
dataBefore().
-
dataAfter
@Nullable org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode dataAfter()Return the after-image of data corresponding to the node.- Returns:
- Node data as they will be present in the tree after the modification is applied
-
findDataAfter
default @NonNull Optional<org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode> findDataAfter()Return the after-image of data corresponding to the node.- Returns:
- Node data as they will be present in the tree after the modification is applied, or empty
- Implementation Requirements:
- Default implementation defers to
Optional.ofNullable(Object)based ondataAfter().
-
getDataAfter
default @NonNull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode getDataAfter()Return the after-image of data corresponding to the node.- Returns:
- Node data as they will be present in the tree after the modification is applied.
- Throws:
com.google.common.base.VerifyException- if no after-image is present- Implementation Requirements:
- Default implementation defers to
dataAfter().
-