Class ImmutableNodes


  • public final class ImmutableNodes
    extends Object
    • Method Detail

      • mapNode

        public static @NonNull SystemMapNode mapNode​(QName name)
        Create an immutable map node.
        Parameters:
        name - QName which will be used as node identifier
        Returns:
        An unordered Map node
      • orderedMapNode

        public static @NonNull UserMapNode orderedMapNode​(QName name)
        Create immutable ordered map node.
        Parameters:
        name - QName which will be used as node identifier
        Returns:
        An ordered Map node
      • leafNode

        public static <T> @NonNull LeafNode<T> leafNode​(YangInstanceIdentifier.NodeIdentifier name,
                                                        T value)
        Construct immutable leaf node.
        Type Parameters:
        T - Type of leaf node value
        Parameters:
        name - Identifier of leaf node
        value - Value of leaf node
        Returns:
        Leaf node with supplied identifier and value
      • leafNode

        public static <T> @NonNull LeafNode<T> leafNode​(QName name,
                                                        T value)
        Construct immutable leaf node.
        Type Parameters:
        T - Type of leaf node value
        Parameters:
        name - QName which will be used as node identifier
        value - Value of leaf node.
        Returns:
        Leaf node with supplied identifier and value
      • containerNode

        public static @NonNull ContainerNode containerNode​(QName name)
        Create an immutable container node.
        Parameters:
        name - QName which will be used as node identifier
        Returns:
        A container node
      • choiceNode

        public static @NonNull ChoiceNode choiceNode​(QName name)
        Create an immutable choice node.
        Parameters:
        name - QName which will be used as node identifier
        Returns:
        A choice node
      • listNode

        public static @NonNull UnkeyedListNode listNode​(QName name)
        Create an immutable list node.
        Parameters:
        name - QName which will be used as node identifier
        Returns:
        An unkeyed list node
      • fromInstanceId

        public static @NonNull NormalizedNode fromInstanceId​(SchemaContext ctx,
                                                             YangInstanceIdentifier id)
        Convert YangInstanceIdentifier into a normalized node structure.
        Parameters:
        ctx - schema context to used during serialization
        id - instance identifier to convert to node structure starting from root
        Returns:
        serialized normalized node for provided instance Id
      • fromInstanceId

        @Deprecated(since="7.0.12",
                    forRemoval=true)
        public static @NonNull NormalizedNode fromInstanceId​(SchemaContext ctx,
                                                             YangInstanceIdentifier id,
                                                             NormalizedNode deepestElement)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This method is a historic hack, which has only a single downstream user. It is scheduled for removal without a replacement.
        Convert YangInstanceIdentifier into a normalized node structure.
        Parameters:
        ctx - schema context to used during serialization
        id - instance identifier to convert to node structure starting from root
        deepestElement - pre-built deepest child that will be inserted at the last path argument of provided instance identifier
        Returns:
        serialized normalized node for provided instance Id with overridden last child.
      • fromInstanceId

        @Deprecated(since="7.0.12",
                    forRemoval=true)
        public static @NonNull NormalizedNode fromInstanceId​(SchemaContext ctx,
                                                             YangInstanceIdentifier id,
                                                             Optional<NormalizedNode> deepestElement)
        Deprecated, for removal: This API element is subject to removal in a future version.
        This method is a historic hack, which has only a single downstream user. It is scheduled for removal without a replacement.
        Convert YangInstanceIdentifier into a normalized node structure.
        Parameters:
        ctx - schema context to used during serialization
        id - instance identifier to convert to node structure starting from root
        deepestElement - pre-built deepest child that will be inserted at the last path argument of provided instance identifier
        Returns:
        serialized normalized node for provided instance Id with (optionally) overridden last child and (optionally) marked with specific operation attribute.