X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FAbstractSoneCommand.java;h=ed5aca8de3ce16dc735a9d9fe0cf4d1f3e6e4be1;hp=87a76e21814065ad3b1f565b9288983b7cf84dee;hb=53aca71a0f7aa4d7b645e9715c94f29ea5ce580f;hpb=01bc879f0f7f33c5321f3ac1ed9bfccf0ab4b433 diff --git a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java index 87a76e2..ed5aca8 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java @@ -44,6 +44,9 @@ public abstract class AbstractSoneCommand extends AbstractCommand { /** The Sone core. */ private final Core core; + /** Whether this command needs write access. */ + private final boolean writeAccess; + /** * Creates a new abstract Sone FCP command. * @@ -51,7 +54,21 @@ public abstract class AbstractSoneCommand extends AbstractCommand { * The Sone core */ protected AbstractSoneCommand(Core core) { + this(core, false); + } + + /** + * Creates a new abstract Sone FCP command. + * + * @param core + * The Sone core + * @param writeAccess + * {@code true} if this command requires write access, + * {@code false} otherwise + */ + protected AbstractSoneCommand(Core core, boolean writeAccess) { this.core = core; + this.writeAccess = writeAccess; } // @@ -67,6 +84,16 @@ public abstract class AbstractSoneCommand extends AbstractCommand { return core; } + /** + * Returns whether this command requires write access. + * + * @return {@code true} if this command require write access, {@code false} + * otherwise + */ + public boolean requiresWriteAccess() { + return writeAccess; + } + // // PROTECTED METHODS //