X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FAbstractSoneCommand.java;h=87a76e21814065ad3b1f565b9288983b7cf84dee;hp=b183121b97a2ac458aa1bc8c719c9d06e95f2586;hb=58ba9d9a5ac37dc2e08d3d0bce762b3f93bc8de8;hpb=67c17c2691e1c00026ed329e8a379a597e4f8ef4 diff --git a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java index b183121..87a76e2 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java @@ -79,15 +79,18 @@ public abstract class AbstractSoneCommand extends AbstractCommand { * @param parameterName * The name under which the Sone ID is stored in the simple field * set + * @param localOnly + * {@code true} to only return local Sones, {@code false} to + * return any Sones * @return The Sone * @throws FcpException * if there is no Sone ID stored under the given parameter name, * or if the Sone ID is invalid */ - protected Sone getSone(SimpleFieldSet simpleFieldSet, String parameterName) throws FcpException { + protected Sone getSone(SimpleFieldSet simpleFieldSet, String parameterName, boolean localOnly) throws FcpException { try { String soneId = simpleFieldSet.getString(parameterName); - Sone sone = core.getSone(soneId, false); + Sone sone = localOnly ? core.getLocalSone(soneId, false) : core.getSone(soneId, false); if (sone == null) { throw new FcpException("Could not load Sone from “" + soneId + "”."); }