diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-05-26 07:42:26 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-05-30 07:20:40 +0200 |
commit | fc4f291590e29f7d576793041ece4081d28c0027 (patch) | |
tree | b8b1797d786d82a821a7e98f0231f2071611e29d /v3po/v3po2vpp/src/main/java/org/opendaylight | |
parent | e6f05b4529b7832249ac131e32008c12a5a7d0da (diff) |
Refactoring ietf-interfaces and ietf-interfaces-state
augumentations provided by v3po.yang:
* using groupings to reduce dupicated definitions
Change-Id: I09c0d0764ba47973f6b8e42d3fed705730e7d652
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/org/opendaylight')
2 files changed, 13 insertions, 12 deletions
diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java index 9443dc2a7..d8b5b65f7 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java @@ -37,7 +37,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Tap; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.VhostUser; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Vxlan; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.l2.VlanTagRewrite; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.attributes.VlanTagRewrite; import org.opendaylight.yangtools.yang.binding.Augmentation; import org.opendaylight.yangtools.yang.binding.ChildOf; @@ -117,7 +117,13 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v final ChildWriter<VlanTagRewrite> vlanTagWriter = new CompositeChildWriter<>(VlanTagRewrite.class, new VlanTagRewriteCustomizer(getVppJvppIfcDependency(), getInterfaceContextDependency())); - final List<ChildWriter<? extends ChildOf<L2>>> l2ChildWriters = Collections.singletonList(vlanTagWriter); + // TODO VlanTagRewrite is ChildOf<L2Attributes>, but L2 extends L2Attributes + // If we use containers inside groupings, we need to cast and lose static type checking. + // Can we get rid of the cast? + final List<ChildWriter<? extends ChildOf<L2>>> l2ChildWriters = + Collections.singletonList((ChildWriter)vlanTagWriter); + + final ChildWriter<L2> l2Writer = new CompositeChildWriter<>(L2.class, l2ChildWriters, RWUtils.emptyAugWriterList(), diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java index 3bc7ad883..4c8202c0b 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java @@ -11,20 +11,18 @@ import io.fd.honeycomb.v3po.translate.impl.read.CompositeChildReader; import io.fd.honeycomb.v3po.translate.impl.read.CompositeListReader; import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader; import io.fd.honeycomb.v3po.translate.read.ChildReader; -import io.fd.honeycomb.v3po.translate.spi.read.ChildReaderCustomizer; import io.fd.honeycomb.v3po.translate.util.RWUtils; import io.fd.honeycomb.v3po.translate.util.read.CloseableReader; import io.fd.honeycomb.v3po.translate.util.read.ReflexiveAugmentReaderCustomizer; import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer; -import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.L2Customizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.EthernetCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer; +import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.L2Customizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.SubInterfaceCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.TapCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VhostUserCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VlanTagRewriteCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VxlanCustomizer; -import io.fd.honeycomb.v3po.translate.write.ChildWriter; import java.util.Collections; import java.util.List; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState; @@ -34,18 +32,14 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces. import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2Builder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.SubInterface; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.l2.VlanTagRewrite; -import org.opendaylight.yangtools.concepts.Builder; -import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.attributes.VlanTagRewrite; import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.opendaylight.yangtools.yang.binding.DataObject; public class InterfacesStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule { @@ -94,7 +88,8 @@ public class InterfacesStateHoneycombReaderModule extends new VlanTagRewriteCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency())); - final List<ChildReader<? extends ChildOf<L2>>> l2ChildReaders = Collections.singletonList(vlanTagReader); + final List<ChildReader<? extends ChildOf<L2>>> l2ChildReaders = + Collections.singletonList((ChildReader)vlanTagReader); // TODO can we get rid of the cast? final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> l2Reader = new CompositeChildReader<>(L2.class, l2ChildReaders, |