Interface BindingDataObjectCodecTreeNode<T extends DataObject>

All Superinterfaces:
BindingCodecTreeNode, BindingDataObjectCodecTreeParent<Empty>, BindingNormalizedNodeCodec<T>, BindingObjectCodecTreeNode<T>
All Known Implementing Classes:
DataObjectCodecContext

@Beta public interface BindingDataObjectCodecTreeNode<T extends DataObject> extends BindingDataObjectCodecTreeParent<Empty>, BindingObjectCodecTreeNode<T>, BindingNormalizedNodeCodec<T>
  • Method Details

    • getBindingClass

      @NonNull Class<T> getBindingClass()
      Returns binding class of interface which represents API of current schema node. The result is same as invoking DataObject.implementedInterface() on instance of data.
      Specified by:
      getBindingClass in interface BindingObjectCodecTreeNode<T extends DataObject>
      Returns:
      interface which defines API of binding representation of data.
    • possibleStreamChild

      <E extends DataObject> Optional<? extends BindingDataObjectCodecTreeNode<E>> possibleStreamChild(@NonNull Class<E> childClass)
      Returns child context as if it was walked by BindingStreamEventWriter. This means that to enter case, one must issue getChild(ChoiceClass).getChild(CaseClass).

      This method differs from BindingDataObjectCodecTreeParent.streamChild(Class), that is less strict for interfaces representing augmentation and cases, that may return BindingCodecTreeNode 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 Argument
      builder - 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 supplied arg 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 supplied arg 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)