From: David ‘Bombe’ Roden Date: Mon, 13 Jul 2015 17:33:14 +0000 (+0200) Subject: Add useful methods X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e6e6f084a26de1e69bca1129c8885aebf7940422;p=jFCPlib.git Add useful methods --- diff --git a/src/main/java/net/pterodactylus/fcp/ModifyPeer.java b/src/main/java/net/pterodactylus/fcp/ModifyPeer.java index 8c911b8..f1905e7 100644 --- a/src/main/java/net/pterodactylus/fcp/ModifyPeer.java +++ b/src/main/java/net/pterodactylus/fcp/ModifyPeer.java @@ -36,14 +36,34 @@ public class ModifyPeer extends FcpMessage { super("ModifyPeer"); setField("NodeIdentifier", nodeIdentifier); if (allowLocalAddresses != null) { - setField("AllowLocalAddresses", String.valueOf(allowLocalAddresses)); + setAllowLocalAddresses(allowLocalAddresses); } if (disabled != null) { - setField("IsDisabled", String.valueOf(disabled)); + setEnabled(!disabled); } if (listenOnly != null) { - setField("IsListenOnly", String.valueOf(listenOnly)); + setListenOnly(listenOnly); } } + public void setAllowLocalAddresses(boolean allowLocalAddresses) { + setField("AllowLocalAddresses", String.valueOf(allowLocalAddresses)); + } + + public void setEnabled(boolean enabled) { + setField("IsDisabled", String.valueOf(!enabled)); + } + + public void setListenOnly(boolean listenOnly) { + setField("IsListenOnly", String.valueOf(listenOnly)); + } + + public void setBurstOnly(boolean burstOnly) { + setField("IsBurstOnly", String.valueOf(burstOnly)); + } + + public void setIgnoreSource(boolean ignoreSource) { + setField("IgnoreSourcePort", String.valueOf(ignoreSource)); + } + }