Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / northbound / commons / src / test / java / org / opendaylight / controller / northbound / commons / query / ReviewBean.java
1 package org.opendaylight.controller.northbound.commons.query;
2
3 import java.util.Date;
4
5 import javax.xml.bind.annotation.XmlElement;
6 import javax.xml.bind.annotation.XmlRootElement;
7
8 /**
9  */
10 @XmlRootElement(name="review")
11 public class ReviewBean {
12     @XmlElement(name="date")
13     private  Date _publishedDate;
14     @XmlElement(name="comment")
15     private  String _comment;
16     @XmlElement(name="reviewer")
17     private  PersonBean _reviewer;
18     @XmlElement
19     private int _upVotes;
20     @XmlElement
21     private int _downVotes;
22     public ReviewBean(){}
23
24     public ReviewBean(String comment, PersonBean user) {
25         _comment = comment;
26         _reviewer = user;
27         _publishedDate = new Date();
28     }
29
30     public void vote(int up, int down) {
31         _upVotes += up;
32         _downVotes += down;
33     }
34
35     @Override
36     public String toString() {
37         return "ReviewBean <publishedDate>" + _publishedDate + "</publishedDate> <comment>"
38                 + _comment + "</comment> <reviewer>" + _reviewer + "</reviewer> <upVotes>" + _upVotes
39                 + "</upVotes> <downVotes>" + _downVotes + "</downVotes>";
40     }
41 }