1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.itracker.model;
20
21 import org.apache.commons.lang.builder.CompareToBuilder;
22 import org.apache.commons.lang.builder.ToStringBuilder;
23
24 import java.util.Comparator;
25
26
27
28
29
30
31
32
33
34
35 public class Report extends AbstractEntity {
36
37 public static final Comparator<Report> NAME_COMPARATOR = new NameComparator();
38
39
40
41 private static final long serialVersionUID = 1L;
42
43 private String name;
44
45 private String nameKey;
46
47 private String description;
48
49 private byte[] fileData;
50
51 private String className;
52
53
54
55
56
57
58
59
60
61
62 public Report() {
63 }
64
65 public String getName() {
66 return name;
67 }
68
69 public void setName(String name) {
70 this.name = name;
71 }
72
73 public String getNameKey() {
74 return nameKey;
75 }
76
77 public void setNameKey(String nameKey) {
78 this.nameKey = nameKey;
79 }
80
81 public String getClassName() {
82 return className;
83 }
84
85 public void setClassName(String className) {
86 this.className = className;
87 }
88
89
90 public String getDescription() {
91 return description;
92 }
93
94 public void setDescription(String description) {
95 this.description = description;
96 }
97
98 public byte[] getFileData() {
99 return fileData;
100 }
101
102 public void setFileData(byte[] fileData) {
103 this.fileData = fileData;
104 }
105
106 @Override
107 public String toString() {
108 return new ToStringBuilder(this).append("id", getId()).append("name",
109 getName()).append("description", getDescription()).append(
110 "nameKey", getNameKey())
111 .toString();
112 }
113
114 private static final class NameComparator implements Comparator<Report> {
115 public int compare(Reporthref="../../../org/itracker/model/Report.html#Report">Report o1, Report o2) {
116 return new CompareToBuilder().append(o1.getName(), o2.getName())
117 .append(o1.getNameKey(), o2.getNameKey()).append(
118 o1.getId(), o2.getId()).toComparison();
119 }
120 }
121
122 }