+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.controller.sal.restconf.impl.test;
import java.util.Collection;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.yangtools.yang.common.RpcError;
-import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.*;
+
+public class DummyRpcResult<T> implements RpcResult<T> {
-public class DummyRpcResult implements RpcResult<TransactionStatus> {
-
private final boolean isSuccessful;
- private final TransactionStatus result;
+ private final T result;
private final Collection<RpcError> errors;
-
+
public DummyRpcResult() {
isSuccessful = false;
result = null;
errors = null;
}
-
- private DummyRpcResult(Builder builder) {
+
+ private DummyRpcResult(Builder<T> builder) {
isSuccessful = builder.isSuccessful;
result = builder.result;
errors = builder.errors;
}
-
- public static Builder builder() {
- return new DummyRpcResult.Builder();
- }
@Override
public boolean isSuccessful() {
}
@Override
- public TransactionStatus getResult() {
+ public T getResult() {
return result;
}
public Collection<RpcError> getErrors() {
return errors;
}
-
- public static class Builder {
+
+ public static class Builder<T> {
private boolean isSuccessful;
- private TransactionStatus result;
+ private T result;
private Collection<RpcError> errors;
-
- public Builder isSuccessful(boolean isSuccessful) {
+
+ public Builder<T> isSuccessful(boolean isSuccessful) {
this.isSuccessful = isSuccessful;
return this;
}
-
- public Builder result(TransactionStatus result) {
+
+ public Builder<T> result(T result) {
this.result = result;
return this;
}
-
- public Builder errors(Collection<RpcError> errors) {
+
+ public Builder<T> errors(Collection<RpcError> errors) {
this.errors = errors;
return this;
}
-
- public RpcResult<TransactionStatus> build() {
- return new DummyRpcResult(this);
+
+ public RpcResult<T> build() {
+ return new DummyRpcResult<T>(this);
}
-
+
}
}