3bd0e0c16fd21b202579557129da70b62f849b58
[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 io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VhostUserCustomizer;
21 import java.util.List;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser;
32 import org.opendaylight.yangtools.yang.binding.ChildOf;
33
34 public class InterfacesStateHoneycombReaderModule extends
35     org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule {
36     public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
37                                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
38         super(identifier, dependencyResolver);
39     }
40
41     public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
42                                                 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
43                                                 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.InterfacesStateHoneycombReaderModule oldModule,
44                                                 java.lang.AutoCloseable oldInstance) {
45         super(identifier, dependencyResolver, oldModule, oldInstance);
46     }
47
48     @Override
49     public void customValidation() {
50         // add custom validation form module attributes here.
51     }
52
53     @Override
54     public java.lang.AutoCloseable createInstance() {
55
56         final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> ethernetReader =
57             new CompositeChildReader<>(Ethernet.class,
58             new EthernetCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
59
60         final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> tapReader =
61             new CompositeChildReader<>(Tap.class,
62             new TapCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
63
64         final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> vhostUserReader =
65             new CompositeChildReader<>(VhostUser.class,
66             new VhostUserCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
67
68         final List<ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>>> childReaders = Lists.newArrayList();
69         childReaders.add(ethernetReader);
70         childReaders.add(tapReader);
71         childReaders.add(vhostUserReader);
72
73         final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader =
74             new CompositeChildReader<>(VppInterfaceStateAugmentation.class,
75                 childReaders,
76                 new ReflexiveAugmentReaderCustomizer<>(VppInterfaceStateAugmentationBuilder.class,
77                     VppInterfaceStateAugmentation.class));
78
79         final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader =
80             new CompositeListReader<>(Interface.class,
81                 emptyChildReaderList(),
82                 singletonAugReaderList(vppInterfaceStateAugmentationChildReader),
83                 new InterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
84
85         return new CloseableReader<>(new CompositeRootReader<>(
86             InterfacesState.class,
87             singletonChildReaderList(interfaceReader),
88             emptyAugReaderList(),
89             new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class)));
90     }
91 }