Interface BindingDataObjectCodecTreeNode<T extends DataObject>
-
- All Superinterfaces:
BindingCodecTreeNode
,BindingNormalizedNodeCodec<T>
,BindingObjectCodecTreeNode<T>
- All Known Implementing Classes:
DataObjectCodecContext
@Beta public interface BindingDataObjectCodecTreeNode<T extends DataObject> extends BindingObjectCodecTreeNode<T>, BindingNormalizedNodeCodec<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BindingDataObjectCodecTreeNode.ChildAddressabilitySummary
Enumeration of possible addressability attribute of all children.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull BindingDataObjectCodecTreeNode<?>
bindingPathArgumentChild(@NonNull InstanceIdentifier.PathArgument arg, @Nullable List<YangInstanceIdentifier.PathArgument> builder)
Returns nested node context using supplied Binding Instance Identifier and adds YANG instance identifiers to the supplied list.@NonNull BindingNormalizedNodeCachingCodec<T>
createCachingCodec(@NonNull ImmutableCollection<Class<? extends BindingObject>> cacheSpecifier)
Returns codec which uses caches serialization / deserialization results.@Nullable InstanceIdentifier.PathArgument
deserializePathArgument(@Nullable YangInstanceIdentifier.PathArgument arg)
Deserializes path argument for current node.@NonNull Class<T>
getBindingClass()
Returns binding class of interface which represents API of current schema node.@NonNull BindingDataObjectCodecTreeNode.ChildAddressabilitySummary
getChildAddressabilitySummary()
Return a summary of addressability of potential children.<E extends DataObject>
Optional<? extends BindingDataObjectCodecTreeNode<E>>possibleStreamChild(@NonNull Class<E> childClass)
Returns child context as if it was walked byBindingStreamEventWriter
.@Nullable YangInstanceIdentifier.PathArgument
serializePathArgument(@Nullable InstanceIdentifier.PathArgument arg)
Serializes path argument for current node.<E extends DataObject>
@NonNull BindingDataObjectCodecTreeNode<E>streamChild(@NonNull Class<E> childClass)
Returns child context as if it was walked byBindingStreamEventWriter
.void
writeAsNormalizedNode(T data, NormalizedNodeStreamWriter writer)
@NonNull BindingCodecTreeNode
yangPathArgumentChild(@NonNull YangInstanceIdentifier.PathArgument child)
Returns nested node context using supplied YANG Instance Identifier.-
Methods inherited from interface org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode
getSchema
-
Methods inherited from interface org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCodec
deserialize, serialize
-
-
-
-
Method Detail
-
getBindingClass
@NonNull Class<T> getBindingClass()
Returns binding class of interface which represents API of current schema node. The result is same as invokingDataObject.implementedInterface()
on instance of data.- Specified by:
getBindingClass
in interfaceBindingObjectCodecTreeNode<T extends DataObject>
- Returns:
- interface which defines API of binding representation of data.
-
streamChild
<E extends DataObject> @NonNull BindingDataObjectCodecTreeNode<E> streamChild(@NonNull Class<E> childClass)
Returns child context as if it was walked byBindingStreamEventWriter
. This means that to enter case, one must issue getChild(ChoiceClass).getChild(CaseClass).- Parameters:
childClass
- Child class by Binding Stream navigation- Returns:
- Context of child
- Throws:
IllegalArgumentException
- If supplied child class is not valid in specified context.
-
possibleStreamChild
<E extends DataObject> Optional<? extends BindingDataObjectCodecTreeNode<E>> possibleStreamChild(@NonNull Class<E> childClass)
Returns child context as if it was walked byBindingStreamEventWriter
. This means that to enter case, one must issue getChild(ChoiceClass).getChild(CaseClass).This method differs from
streamChild(Class)
, that is less strict for interfaces representing augmentation and cases, that may returnBindingCodecTreeNode
even if augmentation interface containing same data was supplied and does not represent augmentation of this node.- Parameters:
childClass
- Child class by Binding Stream navigation- Returns:
- Context of child or Optional.empty is supplied class is not applicable in context.
-
yangPathArgumentChild
@NonNull BindingCodecTreeNode yangPathArgumentChild(@NonNull YangInstanceIdentifier.PathArgument child)
Returns nested node context using supplied YANG Instance Identifier.- Parameters:
child
- Yang Instance Identifier Argument- Returns:
- Context of child
- Throws:
IllegalArgumentException
- If supplied argument does not represent valid child.
-
bindingPathArgumentChild
@NonNull BindingDataObjectCodecTreeNode<?> bindingPathArgumentChild(@NonNull InstanceIdentifier.PathArgument arg, @Nullable List<YangInstanceIdentifier.PathArgument> builder)
Returns nested node context using supplied Binding Instance Identifier and adds YANG instance identifiers to the supplied list.- Parameters:
arg
- Binding Instance Identifier Argumentbuilder
- Mutable instance of list, which is appended by YangInstanceIdentifiers as tree is walked. Use null if such side-product is not needed.- Returns:
- Context of child
- Throws:
IllegalArgumentException
- If supplied argument does not represent valid child.
-
serializePathArgument
@Beta @Nullable YangInstanceIdentifier.PathArgument serializePathArgument(@Nullable InstanceIdentifier.PathArgument arg)
Serializes path argument for current node.- Parameters:
arg
- Binding Path Argument, may be null if Binding Instance Identifier does not have representation for current node (e.g. choice or case).- Returns:
- Yang Path Argument, may be null if Yang Instance Identifier does not have representation for current node (e.g. case).
- Throws:
IllegalArgumentException
- If suppliedarg
is not valid.
-
deserializePathArgument
@Beta @Nullable InstanceIdentifier.PathArgument deserializePathArgument(@Nullable YangInstanceIdentifier.PathArgument arg)
Deserializes path argument for current node.- Parameters:
arg
- Yang Path Argument, may be null if Yang Instance Identifier does not have representation for current node (e.g. case).- Returns:
- Binding Path Argument, may be null if Binding Instance Identifier does not have representation for current node (e.g. choice or case).
- Throws:
IllegalArgumentException
- If suppliedarg
is not valid.
-
getChildAddressabilitySummary
@NonNull BindingDataObjectCodecTreeNode.ChildAddressabilitySummary getChildAddressabilitySummary()
Return a summary of addressability of potential children. Binding specification does not allow all DOM tree elements to be directly addressed, which means some recursive tree operations, like data tree changes do not have a one-to-one mapping from DOM to binding in all cases. This method provides an optimization hint to guide translation of data structures, allowing for fast paths when all children are known to either be addressable or non-addressable.- Returns:
- Summary children addressability.
-
createCachingCodec
@NonNull BindingNormalizedNodeCachingCodec<T> createCachingCodec(@NonNull ImmutableCollection<Class<? extends BindingObject>> cacheSpecifier)
Returns codec which uses caches serialization / deserialization results.Caching may introduce performance penalty to serialization / deserialization but may decrease use of heap for repetitive objects.
- Parameters:
cacheSpecifier
- Set of objects, for which cache may be in place- Returns:
- Codec which uses cache for serialization / deserialization.
-
writeAsNormalizedNode
@Beta void writeAsNormalizedNode(T data, NormalizedNodeStreamWriter writer)
-
-