13fcf008ef4b9ded0cb854a46f0f9af62322d4b3
[hc2vpp.git] /
1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406;
2
3
4 import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyAugReaderList;
5 import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyChildReaderList;
6 import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonAugReaderList;
7 import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonChildReaderList;
8
9 import com.google.common.collect.Lists;
10 import io.fd.honeycomb.v3po.translate.impl.read.CompositeChildReader;
11 import io.fd.honeycomb.v3po.translate.impl.read.CompositeListReader;
12 import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader;
13 import io.fd.honeycomb.v3po.translate.read.ChildReader;
14 import io.fd.honeycomb.v3po.translate.util.read.CloseableReader;
15 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveAugmentReaderCustomizer;
16 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer;
17 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.EthernetCustomizer;
18 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer;
19 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.TapCustomizer;
20 import java.util.List;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap;
30 import org.opendaylight.yangtools.yang.binding.ChildOf;
31
32 public class InterfacesStateHoneycombReaderModule extends
33     org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule {
34     public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
35                                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
36         super(identifier, dependencyResolver);
37     }
38
39     public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
40                                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
41                                                 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.InterfacesStateHoneycombReaderModule oldModule,
42                                                 java.lang.AutoCloseable oldInstance) {
43         super(identifier, dependencyResolver, oldModule, oldInstance);
44     }
45
46     @Override
47     public void customValidation() {
48         // add custom validation form module attributes here.
49     }
50
51     @Override
52     public java.lang.AutoCloseable createInstance() {
53
54         final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> ethernetReader =
55             new CompositeChildReader<>(Ethernet.class,
56             new EthernetCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
57
58         final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> tapReader =
59             new CompositeChildReader<>(Tap.class,
60             new TapCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
61
62         final List<ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>>> childReaders = Lists.newArrayList();
63         childReaders.add(ethernetReader);
64         childReaders.add(tapReader);
65
66         final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader =
67             new CompositeChildReader<>(VppInterfaceStateAugmentation.class,
68                 childReaders,
69                 new ReflexiveAugmentReaderCustomizer<>(VppInterfaceStateAugmentationBuilder.class,
70                     VppInterfaceStateAugmentation.class));
71
72         final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader =
73             new CompositeListReader<>(Interface.class,
74                 emptyChildReaderList(),
75                 singletonAugReaderList(vppInterfaceStateAugmentationChildReader),
76                 new InterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
77
78         return new CloseableReader<>(new CompositeRootReader<>(
79             InterfacesState.class,
80             singletonChildReaderList(interfaceReader),
81             emptyAugReaderList(),
82             new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class)));
83     }
84 }