]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/test/tree/TreeTestResultCollection.java
Make tree test results serializable so that it can be used with ObjectList.
[gpl/argeo-slc.git] / runtime / org.argeo.slc.support.simple / src / main / java / org / argeo / slc / core / test / tree / TreeTestResultCollection.java
1 package org.argeo.slc.core.test.tree;
2
3 import java.util.SortedSet;
4 import java.util.TreeSet;
5
6 public class TreeTestResultCollection implements
7 Comparable<TreeTestResultCollection> {
8 private String id;
9 private SortedSet<TreeTestResult> results = new TreeSet<TreeTestResult>();
10
11 public TreeTestResultCollection() {
12 }
13
14 public TreeTestResultCollection(String id) {
15 this.id = id;
16 }
17
18 public String getId() {
19 return id;
20 }
21
22 public void setId(String id) {
23 this.id = id;
24 }
25
26 public SortedSet<TreeTestResult> getResults() {
27 return results;
28 }
29
30 public void setResults(SortedSet<TreeTestResult> results) {
31 this.results = results;
32 }
33
34 public int compareTo(TreeTestResultCollection o) {
35 return getId().compareTo(o.getId());
36 }
37
38 @Override
39 public boolean equals(Object o) {
40 if (o instanceof TreeTestResultCollection) {
41 return getId().equals(((TreeTestResultCollection) o).getId());
42 }
43 return false;
44 }
45 }