From 70cbc23c51c006fa3838a5ae335f7836be8deeb9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Jul 2015 21:49:13 +0200 Subject: [PATCH] Add constructor that allows handing in an identifier --- src/main/java/net/pterodactylus/fcp/GetNode.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/pterodactylus/fcp/GetNode.java b/src/main/java/net/pterodactylus/fcp/GetNode.java index 3419860..72b90c4 100644 --- a/src/main/java/net/pterodactylus/fcp/GetNode.java +++ b/src/main/java/net/pterodactylus/fcp/GetNode.java @@ -18,6 +18,8 @@ package net.pterodactylus.fcp; +import java.util.Optional; + /** * The “GetNode” command returns the darknet or opennet noderef of the node, * optionally including private and volatile data. @@ -49,7 +51,12 @@ public class GetNode extends FcpMessage { * true to include volatile data in the noderef */ public GetNode(Boolean giveOpennetRef, Boolean withPrivate, Boolean withVolatile) { + this(null, giveOpennetRef, withPrivate, withVolatile); + } + + public GetNode(String identifier, Boolean giveOpennetRef, Boolean withPrivate, Boolean withVolatile) { super("GetNode"); + Optional.ofNullable(identifier).ifPresent(i -> setField("Identifier", i)); if (giveOpennetRef != null) { setField("GiveOpennetRef", String.valueOf(giveOpennetRef)); } -- 2.7.4