2 * Copyright (c) 2014 Cisco Systems, Inc. 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
8 package org.opendaylight.controller.sal.connect.util;
10 import java.util.Collection;
11 import java.util.Collections;
13 import org.opendaylight.yangtools.yang.common.RpcError;
14 import org.opendaylight.yangtools.yang.common.RpcResult;
16 public final class FailedRpcResult<T> implements RpcResult<T> {
18 private final RpcError rpcError;
20 public FailedRpcResult(final RpcError rpcError) {
21 this.rpcError = rpcError;
25 public boolean isSuccessful() {
30 public T getResult() {
35 public Collection<RpcError> getErrors() {
36 return Collections.singletonList(rpcError);