Search in sources :

Example 1 with RootBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder in project controller by opendaylight.

the class Bug2562DeserializedUnkeyedListTest method writeRoot.

private void writeRoot(final LogicalDatastoreType store) {
    final ReadWriteTransaction readWriteTransaction = getDataBroker().newReadWriteTransaction();
    final Barroot barRoot = new BarrootBuilder().setType(2).setValue(2).setKey(new BarrootKey(2)).build();
    final ArrayList<Barroot> barRootList = new ArrayList<>();
    barRootList.add(barRoot);
    final Fooroot fooRoot = new FoorootBuilder().setBarroot(barRootList).build();
    final ArrayList<Fooroot> fooRootList = new ArrayList<>();
    fooRootList.add(fooRoot);
    final Root root = new RootBuilder().setFooroot(fooRootList).build();
    readWriteTransaction.put(store, ROOT_PATH, root);
    assertCommit(readWriteTransaction.submit());
}
Also used : RootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.RootBuilder) Root(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root) Fooroot(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.Fooroot) Barroot(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.Barroot) ArrayList(java.util.ArrayList) BarrootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootBuilder) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) BarrootKey(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootKey) FoorootBuilder(org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.FoorootBuilder)

Example 2 with RootBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder in project controller by opendaylight.

the class Bug3090MultiKeyList method write.

private void write(final LogicalDatastoreType store) {
    final ReadWriteTransaction readWriteTransaction = getDataBroker().newReadWriteTransaction();
    final List<ListInRoot> listInRoots = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        listInRoots.add(new ListInRootBuilder().setLeafA("leaf a" + i).setLeafC("leaf c" + i).setLeafB("leaf b" + i).build());
    }
    final Root root = new RootBuilder().setListInRoot(listInRoots).build();
    readWriteTransaction.put(store, ROOT_PATH, root);
    assertCommit(readWriteTransaction.submit());
}
Also used : RootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder) ListInRootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRootBuilder) Root(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.Root) ListInRoot(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRoot) ArrayList(java.util.ArrayList) ListInRootBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRootBuilder) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction) ListInRoot(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRoot)

Aggregations

ArrayList (java.util.ArrayList)2 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)2 Root (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.Root)1 RootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.RootBuilder)1 Fooroot (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.Fooroot)1 FoorootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.FoorootBuilder)1 Barroot (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.Barroot)1 BarrootBuilder (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootBuilder)1 BarrootKey (org.opendaylight.yang.gen.v1.opendaylight.test.bug._2562.namespace.rev160101.root.fooroot.BarrootKey)1 Root (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.Root)1 RootBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.RootBuilder)1 ListInRoot (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRoot)1 ListInRootBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.opendaylight.test.bug._3090.rev160101.root.ListInRootBuilder)1