X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fadsal%2Fnorthbound%2Fcommons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Fquery%2FReviewBean.java;fp=opendaylight%2Fadsal%2Fnorthbound%2Fcommons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnorthbound%2Fcommons%2Fquery%2FReviewBean.java;h=ea2f873ff6727a576291fc9a05700585be3331fa;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hp=0000000000000000000000000000000000000000;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b;p=controller.git 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 index 0000000000..ea2f873ff6 --- /dev/null +++ b/opendaylight/adsal/northbound/commons/src/test/java/org/opendaylight/controller/northbound/commons/query/ReviewBean.java @@ -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 + " " + + _comment + " " + _reviewer + " " + _upVotes + + " " + _downVotes + ""; + } +}