X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FListPeer.java;h=0ce2a04b85022d7eb4ad100bca296f41d4ca2ad2;hb=23a08a2bd81e2742deb59fca70f6fe7d3a517cfc;hp=e96a389ce5c8415bb0dba48ad488d3b087ba98fa;hpb=b171126719c983b590c51f22eb60a3e0afdf1fb9;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/ListPeer.java b/src/main/java/net/pterodactylus/fcp/ListPeer.java index e96a389..0ce2a04 100644 --- a/src/main/java/net/pterodactylus/fcp/ListPeer.java +++ b/src/main/java/net/pterodactylus/fcp/ListPeer.java @@ -18,6 +18,8 @@ package net.pterodactylus.fcp; +import java.util.Optional; + /** * The “ListPeer” request asks the node about the details of a given peer. * @@ -35,7 +37,12 @@ public class ListPeer extends FcpMessage { * The identifier of the node to get details about */ public ListPeer(String nodeIdentifier) { + this(null, nodeIdentifier); + } + + public ListPeer(String identifier, String nodeIdentifier) { super("ListPeer"); + Optional.ofNullable(identifier).ifPresent(id -> setField("Identifier", id)); setField("NodeIdentifier", nodeIdentifier); }