Merge changes I400fdd74,I18d70f22,Icc83aef3,I3a67dc87,I05b3e988
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / util / ErrorUtil.java
1 /**
2  * Copyright (c) 2016 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
9 package org.opendaylight.openflowplugin.impl.util;
10
11 import java.util.Collection;
12 import org.opendaylight.yangtools.yang.common.RpcError;
13
14 /**
15  * Util class for {@link RpcError}.
16  */
17 public final class ErrorUtil {
18
19     private ErrorUtil() {
20         throw new IllegalStateException("This class should not be instantiated.");
21     }
22
23     public static String errorsToString(final Collection<RpcError> rpcErrors) {
24         final StringBuilder errors = new StringBuilder();
25         if ((null != rpcErrors) && (rpcErrors.size() > 0)) {
26             for (final RpcError rpcError : rpcErrors) {
27                 errors.append(rpcError.getMessage());
28             }
29         }
30         return errors.toString();
31     }
32
33 }