|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.bo.load; |
|
19 |
| |
|
20 |
| import org.qedeq.kernel.base.module.ChapterList; |
|
21 |
| import org.qedeq.kernel.base.module.Header; |
|
22 |
| import org.qedeq.kernel.base.module.LiteratureItemList; |
|
23 |
| import org.qedeq.kernel.bo.module.ModuleAddress; |
|
24 |
| import org.qedeq.kernel.bo.module.ModuleLabels; |
|
25 |
| import org.qedeq.kernel.bo.module.QedeqBo; |
|
26 |
| import org.qedeq.kernel.dto.module.ChapterListVo; |
|
27 |
| import org.qedeq.kernel.dto.module.ChapterVo; |
|
28 |
| import org.qedeq.kernel.dto.module.HeaderVo; |
|
29 |
| import org.qedeq.kernel.dto.module.LiteratureItemListVo; |
|
30 |
| import org.qedeq.kernel.utility.EqualsUtility; |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| public class DefaultQedeqBo implements QedeqBo { |
|
42 |
| |
|
43 |
| |
|
44 |
| private HeaderVo header; |
|
45 |
| |
|
46 |
| |
|
47 |
| private ChapterListVo chapterList; |
|
48 |
| |
|
49 |
| |
|
50 |
| private final ModuleLabels moduleLabels; |
|
51 |
| |
|
52 |
| |
|
53 |
| private LiteratureItemList literatureItemList; |
|
54 |
| |
|
55 |
| |
|
56 |
| private ModuleAddress moduleAddress; |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
78
| public DefaultQedeqBo() {
|
|
62 |
78
| moduleLabels = new ModuleLabels();
|
|
63 |
| } |
|
64 |
| |
|
65 |
| |
|
66 |
| |
|
67 |
| |
|
68 |
| |
|
69 |
| |
|
70 |
50
| public final void setHeader(final HeaderVo header) {
|
|
71 |
50
| this.header = header;
|
|
72 |
| } |
|
73 |
| |
|
74 |
699
| public final Header getHeader() {
|
|
75 |
699
| return header;
|
|
76 |
| } |
|
77 |
| |
|
78 |
| |
|
79 |
| |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
47
| public final void setChapterList(final ChapterListVo chapters) {
|
|
84 |
47
| this.chapterList = chapters;
|
|
85 |
| } |
|
86 |
| |
|
87 |
432
| public final ChapterList getChapterList() {
|
|
88 |
432
| return chapterList;
|
|
89 |
| } |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
| |
|
94 |
| |
|
95 |
| |
|
96 |
7
| public final void addChapter(final ChapterVo chapter) {
|
|
97 |
7
| if (chapterList == null) {
|
|
98 |
4
| chapterList = new ChapterListVo();
|
|
99 |
| } |
|
100 |
7
| chapterList.add(chapter);
|
|
101 |
| } |
|
102 |
| |
|
103 |
| |
|
104 |
| |
|
105 |
| |
|
106 |
| |
|
107 |
| |
|
108 |
18
| public void setLiteratureItemList(final LiteratureItemListVo literatureItemList) {
|
|
109 |
18
| this.literatureItemList = literatureItemList;
|
|
110 |
| } |
|
111 |
| |
|
112 |
291
| public LiteratureItemList getLiteratureItemList() {
|
|
113 |
291
| return literatureItemList;
|
|
114 |
| } |
|
115 |
| |
|
116 |
| |
|
117 |
| |
|
118 |
| |
|
119 |
| |
|
120 |
| |
|
121 |
647
| public final ModuleLabels getModuleLabels() {
|
|
122 |
647
| return moduleLabels;
|
|
123 |
| } |
|
124 |
| |
|
125 |
| |
|
126 |
| |
|
127 |
| |
|
128 |
| |
|
129 |
| |
|
130 |
176
| public final ModuleAddress getModuleAddress() {
|
|
131 |
176
| return moduleAddress;
|
|
132 |
| } |
|
133 |
| |
|
134 |
| |
|
135 |
| |
|
136 |
| |
|
137 |
| |
|
138 |
| |
|
139 |
32
| public final void setModuleAddress(final ModuleAddress address) {
|
|
140 |
32
| this.moduleAddress = address;
|
|
141 |
| } |
|
142 |
| |
|
143 |
71
| public boolean equals(final Object obj) {
|
|
144 |
71
| if (!(obj instanceof DefaultQedeqBo)) {
|
|
145 |
7
| return false;
|
|
146 |
| } |
|
147 |
64
| final DefaultQedeqBo other = (DefaultQedeqBo) obj;
|
|
148 |
64
| return EqualsUtility.equals(getHeader(), other.getHeader())
|
|
149 |
| && EqualsUtility.equals(getChapterList(), other.getChapterList()) |
|
150 |
| && EqualsUtility.equals(getLiteratureItemList(), other.getLiteratureItemList()) |
|
151 |
| && EqualsUtility.equals(getModuleAddress(), other.getModuleAddress()); |
|
152 |
| } |
|
153 |
| |
|
154 |
36
| public int hashCode() {
|
|
155 |
36
| return (getHeader() != null ? getHeader().hashCode() : 0)
|
|
156 |
36
| ^ (getChapterList() != null ? 1 ^ getChapterList().hashCode() : 0)
|
|
157 |
36
| ^ (getLiteratureItemList() != null ? 2 ^ getLiteratureItemList().hashCode() : 0)
|
|
158 |
36
| ^ (getModuleAddress() != null ? 3 ^ getModuleAddress().hashCode() : 0);
|
|
159 |
| } |
|
160 |
| |
|
161 |
39
| public String toString() {
|
|
162 |
39
| final StringBuffer buffer = new StringBuffer();
|
|
163 |
39
| buffer.append(getModuleAddress() + "\n");
|
|
164 |
39
| buffer.append(getHeader() + "\n\n");
|
|
165 |
39
| buffer.append(getChapterList() + "\n\n");
|
|
166 |
39
| buffer.append(getLiteratureItemList());
|
|
167 |
39
| return buffer.toString();
|
|
168 |
| } |
|
169 |
| |
|
170 |
| } |