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
9 package org.opendaylight.dsbenchmark;
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListKey;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerList;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListKey;
20 public final class BaListBuilder {
21 public static List<OuterList> buildOuterList(final int outerElements, final int innerElements) {
22 List<OuterList> outerList = new ArrayList<>(outerElements);
23 for (int j = 0; j < outerElements; j++) {
24 outerList.add(new OuterListBuilder()
26 .setInnerList(buildInnerList(j, innerElements))
27 .withKey(new OuterListKey( j ))
33 private static List<InnerList> buildInnerList( final int index, final int elements ) {
34 List<InnerList> innerList = new ArrayList<>( elements );
36 final String itemStr = "Item-" + String.valueOf(index) + "-";
37 for (int i = 0; i < elements; i++) {
38 innerList.add(new InnerListBuilder()
39 .withKey( new InnerListKey( i ) )
41 .setValue( itemStr + String.valueOf( i ) )