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.AuthorList;
20 import org.qedeq.kernel.se.base.module.Header;
21 import org.qedeq.kernel.se.base.module.ImportList;
22 import org.qedeq.kernel.se.base.module.LatexList;
23 import org.qedeq.kernel.se.base.module.Specification;
24 import org.qedeq.kernel.se.base.module.UsedByList;
25
26
27
28
29
30
31
32
33 public class HeaderVo implements Header {
34
35
36 private Specification specification;
37
38
39 private LatexList title;
40
41
42 private LatexList summary;
43
44
45 private AuthorList authorList;
46
47
48 private ImportList importList;
49
50
51 private UsedByList usedByList;
52
53
54 private String email;
55
56
57
58
59 public HeaderVo() {
60
61 }
62
63
64
65
66
67 public final void setSpecification(final SpecificationVo specification) {
68 this.specification = specification;
69 }
70
71 public final Specification getSpecification() {
72 return specification;
73 }
74
75
76
77
78
79
80 public final void setTitle(final LatexListVo title) {
81 this.title = title;
82 }
83
84 public final LatexList getTitle() {
85 return title;
86 }
87
88
89
90
91
92
93 public final void setSummary(final LatexListVo summary) {
94 this.summary = summary;
95 }
96
97 public final LatexList getSummary() {
98 return summary;
99 }
100
101
102
103
104
105
106 public final void setAuthorList(final AuthorListVo authors) {
107 this.authorList = authors;
108 }
109
110 public final AuthorList getAuthorList() {
111 return authorList;
112 }
113
114
115
116
117
118
119 public final void setImportList(final ImportListVo imports) {
120 this.importList = imports;
121 }
122
123 public final ImportList getImportList() {
124 return importList;
125 }
126
127
128
129
130
131
132 public final void setUsedByList(final UsedByListVo usedby) {
133 this.usedByList = usedby;
134 }
135
136 public final UsedByList getUsedByList() {
137 return usedByList;
138 }
139
140
141
142
143
144
145 public final void setEmail(final String email) {
146 this.email = email;
147 }
148
149 public final String getEmail() {
150 return email;
151 }
152
153 public boolean equals(final Object obj) {
154 if (!(obj instanceof HeaderVo)) {
155 return false;
156 }
157 final HeaderVo other = (HeaderVo) obj;
158 return EqualsUtility.equals(getSpecification(), other.getSpecification())
159 && EqualsUtility.equals(getTitle(), other.getTitle())
160 && EqualsUtility.equals(getSummary(), other.getSummary())
161 && EqualsUtility.equals(getAuthorList(), other.getAuthorList())
162 && EqualsUtility.equals(getImportList(), other.getImportList())
163 && EqualsUtility.equals(getUsedByList(), other.getUsedByList())
164 && EqualsUtility.equals(getEmail(), other.getEmail());
165 }
166
167 public int hashCode() {
168 return (getSpecification() != null ? getSpecification().hashCode() : 0)
169 ^ (getTitle() != null ? 1 ^ getTitle().hashCode() : 0)
170 ^ (getSummary() != null ? 2 ^ getSummary().hashCode() : 0)
171 ^ (getAuthorList() != null ? 3 ^ getAuthorList().hashCode() : 0)
172 ^ (getImportList() != null ? 4 ^ getImportList().hashCode() : 0)
173 ^ (getUsedByList() != null ? 5 ^ getUsedByList().hashCode() : 0)
174 ^ (getEmail() != null ? 6 ^ getEmail().hashCode() : 0);
175 }
176
177 public String toString() {
178 final StringBuffer buffer = new StringBuffer("Header\n");
179 buffer.append(getSpecification() + "\n");
180 buffer.append("Title: ");
181 buffer.append(getTitle() + "\n\n");
182 buffer.append("Abstract: ");
183 buffer.append(getSummary() + "\n\n");
184 buffer.append(getAuthorList() + "\n");
185 buffer.append(getImportList() + "\n");
186 buffer.append(getUsedByList() + "\n");
187 if (getEmail() != null) {
188 buffer.append("\nModule email: <" + getEmail() + ">");
189 }
190 return buffer.toString();
191 }
192
193 }