Add default constructor that creates a random ID.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 May 2009 16:30:04 +0000 (18:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 May 2009 16:30:04 +0000 (18:30 +0200)
src/net/pterodactylus/jsite/core/Request.java

index 395bce1..15dae81 100644 (file)
@@ -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