1 package org.opendaylight.controller.sal.restconf.impl.test;
3 import java.util.Collection;
5 import org.opendaylight.yangtools.yang.common.*;
7 public class DummyRpcResult<T> implements RpcResult<T> {
9 private final boolean isSuccessful;
10 private final T result;
11 private final Collection<RpcError> errors;
13 public DummyRpcResult() {
19 private DummyRpcResult(Builder<T> builder) {
20 isSuccessful = builder.isSuccessful;
21 result = builder.result;
22 errors = builder.errors;
26 public boolean isSuccessful() {
31 public T getResult() {
36 public Collection<RpcError> getErrors() {
40 public static class Builder<T> {
41 private boolean isSuccessful;
43 private Collection<RpcError> errors;
45 public Builder<T> isSuccessful(boolean isSuccessful) {
46 this.isSuccessful = isSuccessful;
50 public Builder<T> result(T result) {
55 public Builder<T> errors(Collection<RpcError> errors) {
60 public RpcResult<T> build() {
61 return new DummyRpcResult<T>(this);