From: David ‘Bombe’ Roden Date: Sat, 23 May 2009 16:30:04 +0000 (+0200) Subject: Add default constructor that creates a random ID. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f62fe4be4c313741b3b7a987f71bb4453fe22604;p=jSite2.git Add default constructor that creates a random ID. --- 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