1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.qedeq.kernel.se.dto.module;
17
18 import org.qedeq.base.utility.EqualsUtility;
19 import org.qedeq.kernel.se.base.module.LatexList;
20 import org.qedeq.kernel.se.base.module.LiteratureItem;
21
22
23
24
25
26
27
28 public class LiteratureItemVo implements LiteratureItem {
29
30
31 private String label;
32
33
34 private LatexList item;
35
36
37
38
39 public LiteratureItemVo() {
40
41 }
42
43
44
45
46
47
48 public final void setLabel(final String label) {
49 this.label = label;
50 }
51
52 public final String getLabel() {
53 return label;
54 }
55
56
57
58
59
60
61 public final void setItem(final LatexListVo item) {
62 this.item = item;
63 }
64
65 public final LatexList getItem() {
66 return item;
67 }
68
69 public boolean equals(final Object obj) {
70 if (!(obj instanceof LiteratureItemVo)) {
71 return false;
72 }
73 final LiteratureItemVo other = (LiteratureItemVo) obj;
74 return EqualsUtility.equals(getLabel(), other.getLabel())
75 && EqualsUtility.equals(getItem(), other.getItem());
76 }
77
78 public int hashCode() {
79 return (getLabel() != null ? getLabel().hashCode() : 0)
80 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
81 }
82
83 public String toString() {
84 final StringBuffer buffer = new StringBuffer();
85 buffer.append("Item label: " + label + "\n");
86 buffer.append(getItem() + "\n");
87 return buffer.toString();
88 }
89
90 }