public static <T> NormalizedNodeAttrBuilder<NodeWithValue, T, LeafSetEntryNode<T>> leafSetEntryBuilder() { return ImmutableLeafSetEntryNodeBuilder.create(); }
public static <T> NormalizedNodeAttrBuilder<NodeWithValue, T, LeafSetEntryNode<T>> leafSetEntryBuilder() { return ImmutableLeafSetEntryNodeBuilder.create(); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
private MapEntryNode toMapEntryNode(TestResult testResult) { YangInstanceIdentifier testResultId = YangInstanceIdentifier.builder().node(TEST_RESULTS_QNAME).node(TEST_RESULT_QNAME).build(); // Construct results list LinkedList<LeafSetEntryNode<Object>> entryList = new LinkedList<>(); for (String result : testResult.getResults()) { LeafSetEntryNode<Object> leafSetEntryNode = ImmutableLeafSetEntryNodeBuilder.create() .withNodeIdentifier(new NodeWithValue(RESULTS_QNAME, result)) .withValue(result) .build(); entryList.add(leafSetEntryNode); } // Construct results LeafSetNode LeafSetNode<?> resultsNode = ImmutableLeafSetNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(RESULTS_QNAME)).withValue(entryList).build(); // Construct test result ContainerNode with 2 children - test-identifier leaf and results leaf-set MapEntryNode testResultNode = ImmutableNodes.mapEntryBuilder() .withNodeIdentifier(new NodeIdentifierWithPredicates(TEST_RESULT_QNAME, TEST_ID_QNAME, testResult.getTestIdentifier())) .withChild(ImmutableNodes.leafNode(TEST_ID_QNAME, testResult.getTestIdentifier())) .withChild(resultsNode) .build(); return(testResultNode); }
private static NormalizedNode<?, ?> createTestContainer() { byte[] bytes1 = {1, 2, 3}; LeafSetEntryNode<Object> entry1 = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(TestModel.BINARY_LEAF_LIST_QNAME, bytes1)).withValue(bytes1).build(); byte[] bytes2 = {}; LeafSetEntryNode<Object> entry2 = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(TestModel.BINARY_LEAF_LIST_QNAME, bytes2)).withValue(bytes2).build(); return TestModel.createBaseTestContainerBuilder() .withChild(ImmutableLeafSetNodeBuilder.create().withNodeIdentifier( new NodeIdentifier(TestModel.BINARY_LEAF_LIST_QNAME)) .withChild(entry1).withChild(entry2).build()) .withChild(ImmutableNodes.leafNode(TestModel.SOME_BINARY_DATA_QNAME, new byte[]{1, 2, 3, 4})) .build(); } }
public static DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> createBaseTestContainerBuilder() { final LeafSetEntryNode<Object> nike = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(SHOE_QNAME, "nike")).withValue("nike").build(); final LeafSetEntryNode<Object> puma = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(SHOE_QNAME, "puma")).withValue("puma").build(); .create() .withNodeIdentifier( new NodeWithValue<>(QName.create( .create() .withNodeIdentifier( new NodeWithValue<>(QName.create( final LeafSetEntryNode<Object> fifteen = ImmutableLeafSetEntryNodeBuilder .create() .withNodeIdentifier( new NodeWithValue<>(QName.create(
private static NormalizedNode<?, ?> createTestContainer() { byte[] bytes1 = {1, 2, 3}; LeafSetEntryNode<Object> entry1 = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(TestModel.BINARY_LEAF_LIST_QNAME, bytes1)).withValue(bytes1).build(); byte[] bytes2 = {}; LeafSetEntryNode<Object> entry2 = ImmutableLeafSetEntryNodeBuilder.create().withNodeIdentifier( new NodeWithValue<>(TestModel.BINARY_LEAF_LIST_QNAME, bytes2)).withValue(bytes2).build(); return TestModel.createBaseTestContainerBuilder() .withChild(ImmutableLeafSetNodeBuilder.create().withNodeIdentifier( new NodeIdentifier(TestModel.BINARY_LEAF_LIST_QNAME)) .withChild(entry1).withChild(entry2).build()) .withChild(ImmutableNodes.leafNode(TestModel.SOME_BINARY_DATA_QNAME, new byte[]{1, 2, 3, 4})) .withChild(ImmutableNodes.leafNode(TestModel.EMPTY_QNAME, Empty.getInstance())) .withChild(Builders.orderedMapBuilder() .withNodeIdentifier(new NodeIdentifier(TestModel.ORDERED_LIST_QNAME)) .withChild(ImmutableNodes.mapEntry(TestModel.ORDERED_LIST_ENTRY_QNAME, TestModel.ID_QNAME, 11)).build()).build(); }