X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Ffcp%2FAbstractCommand.java;h=3ea4804b3100fc2b44c875f984ffa28ad2dd871c;hp=538876aab76c1f4b93379025a2a4b9445e57301a;hb=179e7da4d8d8a474d0b622d60b5f5d32d6ab4052;hpb=f7e2853aebdd167cf73fceeb7bc2e4f92dc3547e diff --git a/src/main/java/net/pterodactylus/sone/freenet/fcp/AbstractCommand.java b/src/main/java/net/pterodactylus/sone/freenet/fcp/AbstractCommand.java index 538876a..3ea4804 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/fcp/AbstractCommand.java +++ b/src/main/java/net/pterodactylus/sone/freenet/fcp/AbstractCommand.java @@ -1,5 +1,5 @@ /* - * Sone - AbstractCommand.java - Copyright © 2011 David Roden + * Sone - AbstractCommand.java - Copyright © 2011–2019 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,8 +23,6 @@ import freenet.support.SimpleFieldSet; /** * Basic implementation of a {@link Command} with various helper methods to * simplify processing of input parameters. - * - * @author David ‘Bombe’ Roden */ public abstract class AbstractCommand implements Command { @@ -44,7 +42,7 @@ public abstract class AbstractCommand implements Command { * if there is no value for the given key in the simple field * set, or the value can not be converted to a String */ - protected String getString(SimpleFieldSet simpleFieldSet, String key) throws FcpException { + protected static String getString(SimpleFieldSet simpleFieldSet, String key) throws FcpException { try { return simpleFieldSet.getString(key); } catch (FSParseException fspe1) { @@ -64,7 +62,7 @@ public abstract class AbstractCommand implements Command { * if there is no value for the given key in the simple field * set, or the value can not be converted to an int */ - protected int getInt(SimpleFieldSet simpleFieldSet, String key) throws FcpException { + protected static int getInt(SimpleFieldSet simpleFieldSet, String key) throws FcpException { try { return simpleFieldSet.getInt(key); } catch (FSParseException fspe1) { @@ -84,7 +82,7 @@ public abstract class AbstractCommand implements Command { * The default value * @return The int value */ - protected int getInt(SimpleFieldSet simpleFieldSet, String key, int defaultValue) { + protected static int getInt(SimpleFieldSet simpleFieldSet, String key, int defaultValue) { return simpleFieldSet.getInt(key, defaultValue); } @@ -100,7 +98,7 @@ public abstract class AbstractCommand implements Command { * if there is no value for the given key in the simple field * set, or the value can not be converted to a boolean */ - protected boolean getBoolean(SimpleFieldSet simpleFieldSet, String key) throws FcpException { + protected static boolean getBoolean(SimpleFieldSet simpleFieldSet, String key) throws FcpException { try { return simpleFieldSet.getBoolean(key); } catch (FSParseException fspe1) { @@ -120,7 +118,7 @@ public abstract class AbstractCommand implements Command { * The default value * @return The boolean value */ - protected boolean getBoolean(SimpleFieldSet simpleFieldSet, String key, boolean defaultValue) { + protected static boolean getBoolean(SimpleFieldSet simpleFieldSet, String key, boolean defaultValue) { return simpleFieldSet.getBoolean(key, defaultValue); }