Move adsal into its own subdirectory.
[controller.git] / opendaylight / adsal / northbound / commons / src / test / java / org / opendaylight / controller / northbound / commons / query / ReviewBean.java
diff --git a/opendaylight/adsal/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/query/ReviewBean.java b/opendaylight/adsal/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/query/ReviewBean.java
new file mode 100644 (file)
index 0000000..ea2f873
--- /dev/null
@@ -0,0 +1,41 @@
+package org.opendaylight.controller.northbound.commons.query;
+
+import java.util.Date;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ */
+@XmlRootElement(name="review")
+public class ReviewBean {
+    @XmlElement(name="date")
+    private  Date _publishedDate;
+    @XmlElement(name="comment")
+    private  String _comment;
+    @XmlElement(name="reviewer")
+    private  PersonBean _reviewer;
+    @XmlElement
+    private int _upVotes;
+    @XmlElement
+    private int _downVotes;
+    public ReviewBean(){}
+
+    public ReviewBean(String comment, PersonBean user) {
+        _comment = comment;
+        _reviewer = user;
+        _publishedDate = new Date();
+    }
+
+    public void vote(int up, int down) {
+        _upVotes += up;
+        _downVotes += down;
+    }
+
+    @Override
+    public String toString() {
+        return "ReviewBean <publishedDate>" + _publishedDate + "</publishedDate> <comment>"
+                + _comment + "</comment> <reviewer>" + _reviewer + "</reviewer> <upVotes>" + _upVotes
+                + "</upVotes> <downVotes>" + _downVotes + "</downVotes>";
+    }
+}