X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FPeer.java;h=f7d33787d0c5639d7d15fcd78b49fdc33a53c0fe;hb=17c6a031550816e0976f0c61ca5854092357e73c;hp=4a21f5cd0651e79455df2fad6d12168590d96d7f;hpb=60fa4ea6401f9cb7b3615f81526fda8212ace6c8;p=jFCPlib.git
diff --git a/src/net/pterodactylus/fcp/Peer.java b/src/net/pterodactylus/fcp/Peer.java
index 4a21f5c..f7d3378 100644
--- a/src/net/pterodactylus/fcp/Peer.java
+++ b/src/net/pterodactylus/fcp/Peer.java
@@ -183,4 +183,33 @@ public class Peer extends BaseMessage {
return FcpUtils.decodeMultiIntegerField(getField("auth.negTypes"));
}
+ /**
+ * Returns one of the volatile fields from the message. The given field name
+ * is prepended with âvolatile.â so if you want to get the value of the
+ * field with the name âvolatile.statusâ you only need to specify âstatusâ.
+ *
+ * @param field
+ * The name of the field
+ * @return The value of the field, or null
if there is no
+ * such field
+ */
+ public String getVolatile(String field) {
+ return getField("volatile." + field);
+ }
+
+ /**
+ * Returns one of the metadata fields from the message. The given field name
+ * is prepended with âmetadata.â so if you want to get the value of the
+ * field with the name âmetadata.timeLastRoutableâ you only need to specify
+ * âtimeLastRoutableâ.
+ *
+ * @param field
+ * The name of the field
+ * @return The value of the field, or null
if there is no
+ * such field
+ */
+ public String getMetadata(String field) {
+ return getField("metadata." + field);
+ }
+
}