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.restconf.impl.test;
10 import java.util.Collection;
12 import org.opendaylight.yangtools.yang.common.RpcError;
13 import org.opendaylight.yangtools.yang.common.RpcResult;
15 public class DummyRpcResult<T> implements RpcResult<T> {
17 private final boolean isSuccessful;
18 private final T result;
19 private final Collection<RpcError> errors;
21 public DummyRpcResult() {
27 private DummyRpcResult(final Builder<T> builder) {
28 isSuccessful = builder.isSuccessful;
29 result = builder.result;
30 errors = builder.errors;
34 public boolean isSuccessful() {
39 public T getResult() {
44 public Collection<RpcError> getErrors() {
48 public static class Builder<T> {
49 private boolean isSuccessful;
51 private Collection<RpcError> errors;
53 public Builder<T> isSuccessful(final boolean isSuccessful) {
54 this.isSuccessful = isSuccessful;
58 public Builder<T> result(final T result) {
63 public Builder<T> errors(final Collection<RpcError> errors) {
68 public RpcResult<T> build() {
69 return new DummyRpcResult<T>(this);