New test utility AssertDataObjects
[mdsal.git] / binding / mdsal-binding-test-utils / src / test / java / org / opendaylight / mdsal / binding / testutils / ExpectedObjects.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.testutils;
9
10 import java.util.Collections;
11 import org.eclipse.xtext.xbase.lib.CollectionLiterals;
12 import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ContainerWithUses;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.complex.from.grouping.ContainerWithUsesBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.Top;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.TopBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelList;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListBuilder;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.binding.rev140701.two.level.list.TopLevelListKey;
22
23 /**
24  * The object initialization code in this class was generated by AssertDataObjects.
25  *
26  * @see AssertDataObjects
27  * @see AssertDataObjectsTest
28  */
29 public class ExpectedObjects {
30
31     public static TopLevelList topLevelList() {
32         TopLevelListBuilder it = new TopLevelListBuilder();
33         TopLevelListKey topLevelListKey = new TopLevelListKey("foo");
34         it.setKey(topLevelListKey);
35         it.setName("foo");
36         TreeComplexUsesAugmentBuilder treeComplexUsesAugmentBuilder = new TreeComplexUsesAugmentBuilder();
37         ContainerWithUsesBuilder containerWithUsesBuilder = new ContainerWithUsesBuilder();
38         containerWithUsesBuilder.setLeafFromGrouping("foo");
39         ContainerWithUses containerWithUses = containerWithUsesBuilder.build();
40         treeComplexUsesAugmentBuilder.setContainerWithUses(containerWithUses);
41         TreeComplexUsesAugment treeComplexUsesAugment = treeComplexUsesAugmentBuilder.build();
42         it.addAugmentation(TreeComplexUsesAugment.class, treeComplexUsesAugment);
43         return it.build();
44     }
45
46     public static Top top() {
47         TopBuilder topBuilder = new TopBuilder();
48         final Procedure1<TopBuilder> _function = (TopBuilder it) -> {
49             TopLevelListBuilder topLevelListBuilder = new TopLevelListBuilder();
50             final Procedure1<TopLevelListBuilder> _function_1 = (TopLevelListBuilder it1) -> {
51                 it1.setName("foo");
52                 TreeComplexUsesAugmentBuilder treeComplexUsesAugmentBuilder = new TreeComplexUsesAugmentBuilder();
53                 final Procedure1<TreeComplexUsesAugmentBuilder> _function_2 = (TreeComplexUsesAugmentBuilder it2) -> {
54                     ContainerWithUsesBuilder containerWithUsesBuilder = new ContainerWithUsesBuilder();
55                     final Procedure1<ContainerWithUsesBuilder> _function_3 = (ContainerWithUsesBuilder it3) -> {
56                         it3.setLeafFromGrouping("foo");
57                     };
58                     ContainerWithUses doubleGreaterThan = XtendBuilderExtensions
59                             .<ContainerWithUses, ContainerWithUsesBuilder>operator_doubleGreaterThan(
60                                     containerWithUsesBuilder, _function_3);
61                     it2.setContainerWithUses(doubleGreaterThan);
62                 };
63                 TreeComplexUsesAugment doubleGreaterThan = XtendBuilderExtensions
64                         .<TreeComplexUsesAugment, TreeComplexUsesAugmentBuilder>operator_doubleGreaterThan(
65                                 treeComplexUsesAugmentBuilder, _function_2);
66                 it1.addAugmentation(TreeComplexUsesAugment.class, doubleGreaterThan);
67             };
68             TopLevelList doubleGreaterThan = XtendBuilderExtensions
69                     .<TopLevelList, TopLevelListBuilder>operator_doubleGreaterThan(topLevelListBuilder, _function_1);
70             it.setTopLevelList(Collections
71                     .<TopLevelList>unmodifiableList(CollectionLiterals.<TopLevelList>newArrayList(doubleGreaterThan)));
72         };
73         return XtendBuilderExtensions.<Top, TopBuilder>operator_doubleGreaterThan(topBuilder, _function);
74     }
75 }