Author: batosai
Date: 2008-08-10 11:14:09 +0000 (Sun, 10 Aug 2008)
New Revision: 21703

Modified:
   trunk/apps/WoT/src/plugins/WoT/Identity.java
Log:
Added a hashMap so clients can set properties (nickname, crypto keys, whatever 
they need) to their identities.

Modified: trunk/apps/WoT/src/plugins/WoT/Identity.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/Identity.java        2008-08-10 10:29:07 UTC 
(rev 21702)
+++ trunk/apps/WoT/src/plugins/WoT/Identity.java        2008-08-10 11:14:09 UTC 
(rev 21703)
@@ -6,6 +6,8 @@
 package plugins.WoT;

 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;

 import com.db4o.ObjectContainer;
 import com.db4o.ObjectSet;
@@ -23,6 +25,7 @@
        FreenetURI requestURI;
        Date lastChange;
        boolean publishTrustList;
+       HashMap<String, String> props;

        /**
         * Create an identity with the given parameters
@@ -36,6 +39,7 @@
                setRequestURI(requestURI);
                setLastChange(lastChange);
                setPublishTrustList(publishTrustList);
+               props = new HashMap<String, String>();
        }

        /**
@@ -103,4 +107,16 @@
        public void setPublishTrustList(boolean publishTrustList) {
                this.publishTrustList = publishTrustList;
        }
+       
+       public void setProp(String key, String value) {
+               props.put(key, value);
+       }
+       
+       public String getProp(String key) {
+               return props.get(key);
+       }
+       
+       public String removeProp(String key) {
+               return props.remove(key);
+       }
 }


Reply via email to