Use ByteBuf.readRetainedSlice()
[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 package org.opendaylight.openflowplugin.impl.util;
9
10 import java.util.Collection;
11 import org.opendaylight.yangtools.yang.common.RpcError;
12
13 /**
14  * Util class for {@link RpcError}.
15  */
16 public final class ErrorUtil {
17     private ErrorUtil() {
18         // Hidden on purpose
19     }
20
21     public static String errorsToString(final Collection<RpcError> rpcErrors) {
22         final StringBuilder errors = new StringBuilder();
23         if ((null != rpcErrors) && (rpcErrors.size() > 0)) {
24             for (final RpcError rpcError : rpcErrors) {
25                 errors.append(rpcError.getMessage());
26             }
27         }
28         return errors.toString();
29     }
30
31 }