From f62fe4be4c313741b3b7a987f71bb4453fe22604 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 23 May 2009 18:30:04 +0200 Subject: [PATCH] Add default constructor that creates a random ID. --- src/net/pterodactylus/jsite/core/Request.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/net/pterodactylus/jsite/core/Request.java b/src/net/pterodactylus/jsite/core/Request.java index 395bce1..15dae81 100644 --- a/src/net/pterodactylus/jsite/core/Request.java +++ b/src/net/pterodactylus/jsite/core/Request.java @@ -19,6 +19,9 @@ package net.pterodactylus.jsite.core; +import net.pterodactylus.jsite.util.IdGenerator; +import net.pterodactylus.util.number.Hex; + /** * Wraps a request that is executed by the Freenet node. * @@ -33,6 +36,13 @@ public class Request { private String clientToken; /** + * Creates a new request with a random ID. + */ + public Request() { + this(Hex.toHex(IdGenerator.generateId())); + } + + /** * Creates a new request. * * @param id -- 2.7.4