2 * Copyright (c) 2015 Cisco Systems and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.dsbenchmark;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListBuilder;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListKey;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerList;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListKey;
19 public final class BaListBuilder {
20 private BaListBuilder() {
24 public static List<OuterList> buildOuterList(final int outerElements, final int innerElements) {
25 List<OuterList> outerList = new ArrayList<>(outerElements);
26 for (int j = 0; j < outerElements; j++) {
27 outerList.add(new OuterListBuilder()
29 .setInnerList(buildInnerList(j, innerElements))
30 .withKey(new OuterListKey(j))
36 private static List<InnerList> buildInnerList(final int index, final int elements) {
37 List<InnerList> innerList = new ArrayList<>(elements);
39 final String itemStr = "Item-" + String.valueOf(index) + "-";
40 for (int i = 0; i < elements; i++) {
41 innerList.add(new InnerListBuilder()
42 .withKey(new InnerListKey(i))
44 .setValue(itemStr + String.valueOf(i))