Author: batosai
Date: 2008-06-15 14:14:02 +0000 (Sun, 15 Jun 2008)
New Revision: 20353

Modified:
   trunk/apps/WoT/src/plugins/WoT/Trust.java
Log:
Added the possibility to give a comment on a trust relationship, so users can 
explain why they trust/distrust one particular identity.

Modified: trunk/apps/WoT/src/plugins/WoT/Trust.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/Trust.java   2008-06-14 20:02:30 UTC (rev 
20352)
+++ trunk/apps/WoT/src/plugins/WoT/Trust.java   2008-06-15 14:14:02 UTC (rev 
20353)
@@ -23,6 +23,7 @@
        private Identity truster;
        private Identity trustee;
        private int value;
+       private String comment;


        /**
@@ -38,6 +39,13 @@
                setValue(value);
        }

+       public Trust(Identity truster, Identity trustee, int value, String 
comment) {
+               this.truster = truster;
+               this.trustee = trustee;
+               setValue(value);
+               this.comment = comment;
+       }
+       
        /**
         * 
         * @param xmlDoc XML document
@@ -46,6 +54,7 @@
        public Element toXML(Document xmlDoc) {
                Element elem = xmlDoc.createElement("trust");
                elem.setAttribute("value", String.valueOf(value));
+               elem.setAttribute("comment", comment);
                elem.setTextContent(trustee.getRequestURI());

                return elem;
@@ -94,4 +103,20 @@
                        this.value = value;
                }
        }
+
+       /**
+        * 
+        * @return Comment
+        */
+       public String getComment() {
+               return comment;
+       }
+
+       /**
+        * 
+        * @param comment Comment on that trust relationship
+        */
+       public void setComment(String comment) {
+               this.comment = comment;
+       }
 }


Reply via email to