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.*;
14 public class DummyRpcResult<T> implements RpcResult<T> {
16 private final boolean isSuccessful;
17 private final T result;
18 private final Collection<RpcError> errors;
20 public DummyRpcResult() {
26 private DummyRpcResult(Builder<T> builder) {
27 isSuccessful = builder.isSuccessful;
28 result = builder.result;
29 errors = builder.errors;
33 public boolean isSuccessful() {
38 public T getResult() {
43 public Collection<RpcError> getErrors() {
47 public static class Builder<T> {
48 private boolean isSuccessful;
50 private Collection<RpcError> errors;
52 public Builder<T> isSuccessful(boolean isSuccessful) {
53 this.isSuccessful = isSuccessful;
57 public Builder<T> result(T result) {
62 public Builder<T> errors(Collection<RpcError> errors) {
67 public RpcResult<T> build() {
68 return new DummyRpcResult<T>(this);