1 | |
package org.jtheque.films.services.impl.utils.file.jt; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
import org.jtheque.core.utils.file.jt.AbstractJTFileHeader; |
20 | |
import org.jtheque.core.utils.file.jt.able.JTNotZippedFile; |
21 | |
import org.jtheque.films.persistence.od.able.Film; |
22 | |
import org.jtheque.films.services.impl.utils.file.jt.header.JTFFileHeader; |
23 | |
import org.jtheque.primary.od.able.Country; |
24 | |
import org.jtheque.primary.od.able.Kind; |
25 | |
import org.jtheque.primary.od.able.Language; |
26 | |
import org.jtheque.primary.od.able.Person; |
27 | |
import org.jtheque.primary.od.able.Type; |
28 | |
|
29 | |
import java.util.ArrayList; |
30 | |
import java.util.Collection; |
31 | |
import java.util.HashSet; |
32 | |
import java.util.Set; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | 0 | public final class JTFFile implements JTNotZippedFile { |
40 | |
private Film film; |
41 | |
private Set<Person> actors; |
42 | |
private Set<Kind> kinds; |
43 | |
private Person realizer; |
44 | |
private Language language; |
45 | |
private Type type; |
46 | |
private Collection<Country> countries; |
47 | |
|
48 | 0 | private boolean correctSeparators = true; |
49 | |
|
50 | 0 | private final AbstractJTFileHeader header = new JTFFileHeader(); |
51 | |
|
52 | |
@Override |
53 | |
public AbstractJTFileHeader getHeader() { |
54 | 0 | return header; |
55 | |
} |
56 | |
|
57 | |
@Override |
58 | |
public boolean isValid() { |
59 | 0 | return film != null && header.isComplete() && correctSeparators; |
60 | |
} |
61 | |
|
62 | |
@Override |
63 | |
public boolean isCorrectSeparators() { |
64 | 0 | return correctSeparators; |
65 | |
} |
66 | |
|
67 | |
@Override |
68 | |
public void setCorrectSeparators(boolean correctSeparators) { |
69 | 0 | this.correctSeparators = correctSeparators; |
70 | 0 | } |
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
public Iterable<Person> getActors() { |
78 | 0 | return actors; |
79 | |
} |
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public void setActors(Set<Person> actors) { |
87 | 0 | this.actors = new HashSet<Person>(actors); |
88 | 0 | } |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
public Iterable<Kind> getKinds() { |
96 | 0 | return kinds; |
97 | |
} |
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
public void setKinds(Set<Kind> kinds) { |
105 | 0 | this.kinds = new HashSet<Kind>(kinds); |
106 | 0 | } |
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
public Film getFilm() { |
114 | 0 | return film; |
115 | |
} |
116 | |
|
117 | |
|
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
public void setFilm(Film film) { |
123 | 0 | this.film = film; |
124 | 0 | } |
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
public Language getLanguage() { |
132 | 0 | return language; |
133 | |
} |
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
public void setLanguage(Language language) { |
141 | 0 | this.language = language; |
142 | 0 | } |
143 | |
|
144 | |
|
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
public Iterable<Country> getCountries() { |
150 | 0 | return countries; |
151 | |
} |
152 | |
|
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
public void setCountries(Collection<Country> countries) { |
159 | 0 | this.countries = new ArrayList<Country>(countries); |
160 | 0 | } |
161 | |
|
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
public Person getRealizer() { |
168 | 0 | return realizer; |
169 | |
} |
170 | |
|
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
|
176 | |
public void setRealizer(Person realizer) { |
177 | 0 | this.realizer = realizer; |
178 | 0 | } |
179 | |
|
180 | |
|
181 | |
|
182 | |
|
183 | |
|
184 | |
|
185 | |
public Type getType() { |
186 | 0 | return type; |
187 | |
} |
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
|
193 | |
|
194 | |
public void setType(Type type) { |
195 | 0 | this.type = type; |
196 | 0 | } |
197 | |
} |