From: David ‘Bombe’ Roden Date: Wed, 9 Apr 2008 17:22:56 +0000 (+0000) Subject: add hasField(String) X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f8dd2e5b5a74c2e4d49cb22fc89befd7325ec485;p=jSite2.git add hasField(String) git-svn-id: http://trooper/svn/projects/jSite/trunk@672 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/util/fcp/FcpMessage.java b/src/net/pterodactylus/util/fcp/FcpMessage.java index cb0c068..6782868 100644 --- a/src/net/pterodactylus/util/fcp/FcpMessage.java +++ b/src/net/pterodactylus/util/fcp/FcpMessage.java @@ -87,6 +87,18 @@ public class FcpMessage implements Iterable { } /** + * Checks whether this message has a field with the given name. + * + * @param field + * The name of the field to check for + * @return true if the message has a field with the given + * name, false otherwise + */ + public boolean hasField(String field) { + return fields.containsKey(field); + } + + /** * Sets the field with the given name to the given value. If the field * already exists in this message it is overwritten. *