From adfe0cdb33f5d1a5a371e2cc35808550c4e4ab73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 3 Jun 2008 08:50:02 +0200 Subject: [PATCH] create id in constructor --- src/net/pterodactylus/jsite/core/Node.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/net/pterodactylus/jsite/core/Node.java b/src/net/pterodactylus/jsite/core/Node.java index 5a8ec89..bb61ee9 100644 --- a/src/net/pterodactylus/jsite/core/Node.java +++ b/src/net/pterodactylus/jsite/core/Node.java @@ -21,7 +21,9 @@ package net.pterodactylus.jsite.core; import java.beans.PropertyChangeListener; +import net.pterodactylus.jsite.util.IdGenerator; import net.pterodactylus.util.beans.AbstractBean; +import net.pterodactylus.util.number.Hex; /** * Container for a Freenet node. A Node is capable of notifying @@ -53,6 +55,13 @@ public class Node extends AbstractBean { private int port; /** + * Creates a new node. + */ + public Node() { + id = Hex.toHex(IdGenerator.generateId()); + } + + /** * Returns the internal ID of the node. * * @return The internal ID of the node -- 2.7.4