Update MRI projects for Aluminium
[openflowplugin.git] / applications / forwardingrules-sync / src / test / java / org / opendaylight / openflowplugin / applications / frsync / impl / DSInputFactory.java
index 2d8eb77c7e943d51be3dfed2a67945bef61ba5fd..2fdf40625904b8bf797cb7a3bfd40b1e6501a7d7 100644 (file)
@@ -1,11 +1,10 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * 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.applications.frsync.impl;
 
 import java.util.ArrayList;
@@ -20,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.acti
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterBuilder;
@@ -45,12 +45,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter
 
 /**
  * Provides create methods for dataObjects involved in
- * {@link org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener} by inventory.
+ * {@link org.opendaylight.mdsal.binding.api.DataTreeChangeListener} by inventory.
  */
-public class DSInputFactory {
+public final class DSInputFactory {
+    private DSInputFactory() {
+    }
+
     public static Group createGroup(final long groupIdValue) {
         final Buckets buckets = new BucketsBuilder()
-                .setBucket(Collections.<Bucket>emptyList())
+                .setBucket(Collections.emptyList())
                 .build();
         return new GroupBuilder()
                 .setGroupId(new GroupId(groupIdValue))
@@ -131,6 +134,7 @@ public class DSInputFactory {
 
     public static Group createGroupWithPreconditions(final long groupIdValue, final long... requiredId) {
         final List<Action> actionBag = new ArrayList<>();
+        int key = 0;
         for (long groupIdPrecondition : requiredId) {
             final GroupAction groupAction = new GroupActionBuilder()
                     .setGroupId(groupIdPrecondition)
@@ -140,6 +144,7 @@ public class DSInputFactory {
                     .build();
             final Action action = new ActionBuilder()
                     .setAction(groupActionCase)
+                    .withKey(new ActionKey(key++))
                     .build();
             actionBag.add(action);
         }