X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2Fhighlevel%2FHighLevelResult.java;h=5975394612f9b90b3c65f5ce1df121b55640d449;hb=fe63c7b7081dec41b85df862cb8358fcfbeb452e;hp=b61036e53532e419bf9a9cfee4779bc0703580b8;hpb=7020af8093e423c6a990a6db20da3514ac56236a;p=jFCPlib.git diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelResult.java b/src/net/pterodactylus/fcp/highlevel/HighLevelResult.java index b61036e..5975394 100644 --- a/src/net/pterodactylus/fcp/highlevel/HighLevelResult.java +++ b/src/net/pterodactylus/fcp/highlevel/HighLevelResult.java @@ -20,13 +20,57 @@ package net.pterodactylus.fcp.highlevel; /** - * Marker interface for results of {@link HighLevelClient} operations. + * Base class for results of {@link HighLevelClient} operations. * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ -public interface HighLevelResult { +public abstract class HighLevelResult { - /* intentionally left blank. */ + /** The identifier of the request. */ + private final String identifier; + + /** Whether the operation failed. */ + private boolean failed; + + /** + * Package-private constructor. + * + * @param identifier + * The identifier of the request + */ + HighLevelResult(String identifier) { + this.identifier = identifier; + } + + /** + * Returns the identifier of the underlying request. + * + * @return The identifier of the request + */ + public String getIdentifier() { + return identifier; + } + + /** + * Returns whether the operation failed. + * + * @return true if the operation failed, false + * otherwise + */ + public boolean isFailed() { + return failed; + } + + /** + * Sets whether the operation failed. + * + * @param failed + * true if the operation failed, + * false otherwise + */ + void setFailed(boolean failed) { + this.failed = failed; + } }