import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.desc.stats.reply.GroupDescStatsKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.group.desc._case.multipart.reply.group.desc.GroupDesc;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
/**
- * Converts GroupDesc message from library to MD SAL defined GroupDescStats
+ * Converts GroupDesc message from library to MD SAL defined GroupDescStats.
*
+ * <p>
* Example usage:
* <pre>
* {@code
* }
* </pre>
*/
-public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>, List<GroupDescStats>, VersionConvertorData> {
+public class GroupDescStatsResponseConvertor extends Convertor<List<GroupDesc>, List<GroupDescStats>,
+ VersionConvertorData> {
private static final Set<Class<?>> TYPES = Collections.singleton(GroupDesc.class);
- private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(List<BucketsList> bucketDescStats, short version) {
+ private org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.Buckets toSALBucketsDesc(
+ List<BucketsList> bucketDescStats, short version) {
final ActionResponseConvertorData data = new ActionResponseConvertorData(version);
- data.setActionPath(ActionPath.GROUPDESCSTATSUPDATED_GROUPDESCSTATS_BUCKETS_BUCKET_ACTION);
+ data.setActionPath(ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION);
org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder salBucketsDesc =
new org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.BucketsBuilder();
for (BucketsList bucketDetails : bucketDescStats) {
BucketBuilder bucketDesc = new BucketBuilder();
- final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>> convertedSalActions =
- getConvertorExecutor().convert(
- bucketDetails.getAction(), data);
-
+ final Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action>>
+ convertedSalActions = getConvertorExecutor().convert(bucketDetails.getAction(), data);
if (convertedSalActions.isPresent()) {
List<Action> actions = new ArrayList<>();
int actionKey = 0;
- for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action : convertedSalActions.get()) {
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action :
+ convertedSalActions.get()) {
ActionBuilder wrappedAction = new ActionBuilder();
wrappedAction.setAction(action);
- wrappedAction.setKey(new ActionKey(actionKey));
+ wrappedAction.withKey(new ActionKey(actionKey));
wrappedAction.setOrder(actionKey);
actions.add(wrappedAction.build());
actionKey++;
bucketDesc.setWatchGroup(bucketDetails.getWatchGroup());
BucketId bucketId = new BucketId((long) bucketKey);
bucketDesc.setBucketId(bucketId);
- bucketDesc.setKey(new BucketKey(bucketId));
+ bucketDesc.withKey(new BucketKey(bucketId));
bucketKey++;
allBuckets.add(bucketDesc.build());
}
salGroupDescStats.setBuckets(toSALBucketsDesc(groupDesc.getBucketsList(), data.getVersion()));
salGroupDescStats.setGroupId(new GroupId(groupDesc.getGroupId().getValue()));
salGroupDescStats.setGroupType(GroupTypes.forValue(groupDesc.getType().getIntValue()));
- salGroupDescStats.setKey(new GroupDescStatsKey(salGroupDescStats.getGroupId()));
+ salGroupDescStats.withKey(new GroupDescStatsKey(salGroupDescStats.getGroupId()));
convertedSALGroupsDesc.add(salGroupDescStats.build());
}
return convertedSALGroupsDesc;
}
-}
\ No newline at end of file
+}