Adapt TransportPCE code to Chlorine
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMappingVersion121.java
index c1cb74097e2af0fde40658c0f5e1a57b98fb0aef..cded0f0779dff2d7e1089aa6dc9ed7a65b0c1b1d 100644 (file)
@@ -621,22 +621,21 @@ public class PortMappingVersion121 {
             }
             LOG.debug(PortMappingUtils.GOT_INTF_LOGMSG,
                 nodeId, openRoadmInterface.get().getName(), openRoadmInterface.get().getType());
-            Class<? extends InterfaceType> interfaceType
-                = (Class<? extends InterfaceType>) openRoadmInterface.get().getType();
+            InterfaceType interfaceType = openRoadmInterface.get().getType();
             // Check if interface type is OMS or OTS
-            if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
+            if (interfaceType.equals(OpenROADMOpticalMultiplex.VALUE)) {
                 mpBldr.setSupportingOms(interfaces.getInterfaceName());
             }
-            if (interfaceType.equals(OpticalTransport.class)) {
+            if (interfaceType.equals(OpticalTransport.VALUE)) {
                 mpBldr.setSupportingOts(interfaces.getInterfaceName());
             }
-            if (interfaceType.equals(OtnOtu.class)) {
+            if (interfaceType.equals(OtnOtu.VALUE)) {
                 mpBldr.setSupportingOtu4(interfaces.getInterfaceName());
             }
-            if (interfaceType.equals(OtnOdu.class)) {
+            if (interfaceType.equals(OtnOdu.VALUE)) {
                 mpBldr.setSupportingOdu4(interfaces.getInterfaceName());
             }
-            if (interfaceType.equals(EthernetCsmacd.class)) {
+            if (interfaceType.equals(EthernetCsmacd.VALUE)) {
                 mpBldr.setSupportingEthernet(interfaces.getInterfaceName());
             }
         }
@@ -655,8 +654,8 @@ public class PortMappingVersion121 {
 
     private Mapping createNewXpdrMapping(String nodeId, Ports port, String circuitPackName,
             String logicalConnectionPoint, String partnerLcp) {
-        Set<Class<? extends org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211
-            .SupportedIfCapability>> supportedIntf = new HashSet<>();
+        Set<org.opendaylight.yang.gen.v1.http.org.openroadm.port.types.rev201211.SupportedIfCapability> supportedIntf =
+            new HashSet<>();
         for (String sup: getSupIfCapList(port)) {
             if (MappingUtilsImpl.convertSupIfCapa(sup) != null) {
                 supportedIntf.add(MappingUtilsImpl.convertSupIfCapa(sup));
@@ -687,12 +686,12 @@ public class PortMappingVersion121 {
     }
 
     private List<String> getSupIfCapList(Ports port) {
-        Set<Class<? extends SupportedIfCapability>> supIfCapClassList = port.getSupportedInterfaceCapability();
+        Set<SupportedIfCapability> supIfCapClassList = port.getSupportedInterfaceCapability();
         return
             supIfCapClassList == null
                 ? Collections.emptyList()
                 : supIfCapClassList
-                    .stream().map(e -> e.getSimpleName())
+                    .stream().map(e -> e.toString())
                     .collect(Collectors.toList());
     }