X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FListPeer.java;h=0ce2a04b85022d7eb4ad100bca296f41d4ca2ad2;hb=1dc2d51171c64586f934d3a9e2da0741c543a91a;hp=f16f38506e1aee8bd17dca1d66d2081e9d4fca08;hpb=508624458578f01a393f8b44f32b98b40054fdc8;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/ListPeer.java b/src/main/java/net/pterodactylus/fcp/ListPeer.java index f16f385..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. * @@ -27,15 +29,20 @@ public class ListPeer extends FcpMessage { /** * Creates a new “ListPeer” request that returns information about the node - * specified by nodeIdentifier. nodeIdentifier can - * be of several formats: The node’s name, its identity, or its IP address - * and port (connection with a ‘:’). + * specified by nodeIdentifier. nodeIdentifier + * can be of several formats: The node’s name, its identity, or its IP + * address and port (connection with a ‘:’). * * @param nodeIdentifier * 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); }