4b8294d6d5ef33cb42fdc65c5f7784c42e887b5c
[openflowplugin.git] / extension / openflowplugin-extension-onf / src / test / java / org / opendaylight / openflowplugin / extension / onf / BundleTestUtils.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.openflowplugin.extension.onf;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundlePropertyType;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.common.grouping.BundleProperty;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.common.grouping.BundlePropertyBuilder;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.property.grouping.bundle.property.entry.BundlePropertyExperimenterBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.property.grouping.bundle.property.entry.bundle.property.experimenter.BundlePropertyExperimenterData;
16 import org.opendaylight.yangtools.yang.common.Uint32;
17
18 /**
19  * Abstract class for common Converter util methods.
20  */
21 public abstract class BundleTestUtils {
22
23     public static BundleProperty createExperimenterProperty(final BundlePropertyExperimenterData data) {
24         return new BundlePropertyBuilder()
25                 .setType(BundlePropertyType.ONFETBPTEXPERIMENTER)
26                 .setBundlePropertyEntry(new BundlePropertyExperimenterBuilder()
27                         .setExperimenter(new ExperimenterId(Uint32.ONE))
28                         .setExpType(Uint32.TWO)
29                         .setBundlePropertyExperimenterData(data)
30                         .build())
31                 .build();
32     }
33
34 }