squashed test fix
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / core / RpcResultsUtil.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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.openflow.md.core;
9
10 import java.util.Collection;
11 import java.util.Collections;
12 import org.opendaylight.controller.sal.common.util.Rpcs;
13 import org.opendaylight.yangtools.yang.common.RpcError;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
15
16 /**
17  * Created by Martin Bobak mbobak@cisco.com on 8/25/14.
18  */
19 public class RpcResultsUtil {
20
21     /**
22      * @param success
23      * @param result
24      * @param errors
25      * @return
26      */
27     public static <T> RpcResult<T> createRpcResult(boolean success, T result, Collection<RpcError> errorsArg) {
28         Collection<RpcError> errors = errorsArg;
29         if (errors == null) {
30             errors = Collections.emptyList();
31         }
32         return Rpcs.getRpcResult(success, result, errors);
33     }
34
35 }