X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FDummyRpcResult.java;h=16d14842db3c2cc02684e244a219f7d20da03daf;hb=48814d6a264b8f13e5db1422336d9ef25cb05fa9;hp=5ab4f99fdc07a20c78d65343b1b2dba0f3afd210;hpb=c57785bd755dfdeaf829ce80a4b8b383d8c04602;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/DummyRpcResult.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/DummyRpcResult.java index 5ab4f99fdc..16d14842db 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/DummyRpcResult.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/DummyRpcResult.java @@ -1,32 +1,34 @@ +/* + * 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; -public class DummyRpcResult implements RpcResult { - +public class DummyRpcResult implements RpcResult { + private final boolean isSuccessful; - private final TransactionStatus result; + private final T result; private final Collection errors; - + public DummyRpcResult() { isSuccessful = false; result = null; errors = null; } - - private DummyRpcResult(Builder builder) { + + private DummyRpcResult(final Builder builder) { isSuccessful = builder.isSuccessful; result = builder.result; errors = builder.errors; } - - public static Builder builder() { - return new DummyRpcResult.Builder(); - } @Override public boolean isSuccessful() { @@ -34,7 +36,7 @@ public class DummyRpcResult implements RpcResult { } @Override - public TransactionStatus getResult() { + public T getResult() { return result; } @@ -42,31 +44,31 @@ public class DummyRpcResult implements RpcResult { public Collection getErrors() { return errors; } - - public static class Builder { + + public static class Builder { private boolean isSuccessful; - private TransactionStatus result; + private T result; private Collection errors; - - public Builder isSuccessful(boolean isSuccessful) { + + public Builder isSuccessful(final boolean isSuccessful) { this.isSuccessful = isSuccessful; return this; } - - public Builder result(TransactionStatus result) { + + public Builder result(final T result) { this.result = result; return this; } - - public Builder errors(Collection errors) { + + public Builder errors(final Collection errors) { this.errors = errors; return this; } - - public RpcResult build() { - return new DummyRpcResult(this); + + public RpcResult build() { + return new DummyRpcResult(this); } - + } }