Bump upstreams
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / match / cases / OfToSalVlanVidCase.java
index edff8c63ad83214a43f5d95c3b7a4544ab891c5a..e8776b36716562c68b6dfe5dc55534af8f180180 100644 (file)
@@ -5,18 +5,16 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.cases;
 
 import java.util.Optional;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorCase;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.data.MatchResponseConvertorData;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.vlan.vid._case.VlanVid;
@@ -27,18 +25,17 @@ public class OfToSalVlanVidCase extends ConvertorCase<VlanVidCase, MatchBuilder,
     }
 
     @Override
-    public Optional<MatchBuilder> process(@Nonnull VlanVidCase source, MatchResponseConvertorData data, ConvertorExecutor convertorExecutor) {
+    public Optional<MatchBuilder> process(@NonNull final VlanVidCase source, final MatchResponseConvertorData data,
+            final ConvertorExecutor convertorExecutor) {
         final MatchBuilder matchBuilder = data.getMatchBuilder();
-        final VlanMatchBuilder vlanMatchBuilder = data.getVlanMatchBuilder();
-
         final VlanVid vlanVid = source.getVlanVid();
-
         if (vlanVid != null) {
-            VlanIdBuilder vlanBuilder = new VlanIdBuilder();
-            vlanBuilder.setVlanId(new VlanId(vlanVid.getVlanVid()));
-            vlanBuilder.setVlanIdPresent(vlanVid.isCfiBit());
-            vlanMatchBuilder.setVlanId(vlanBuilder.build());
-            matchBuilder.setVlanMatch(vlanMatchBuilder.build());
+            matchBuilder.setVlanMatch(data.getVlanMatchBuilder()
+                .setVlanId(new VlanIdBuilder()
+                    .setVlanId(new VlanId(vlanVid.getVlanVid()))
+                    .setVlanIdPresent(vlanVid.getCfiBit())
+                    .build())
+                .build());
         }
 
         return Optional.of(matchBuilder);