X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FPeer.java;h=f7d33787d0c5639d7d15fcd78b49fdc33a53c0fe;hb=4bdce9b8232e900d6c7fbfea7823505412cb7a32;hp=4a21f5cd0651e79455df2fad6d12168590d96d7f;hpb=c10df447d6d7354fdd20e8c3a2c97e5df6286012;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); + } + }