|
15 | 15 | import com.iab.gpp.encoder.section.Sections; |
16 | 16 | import com.iab.gpp.encoder.section.TcfCaV1; |
17 | 17 | import com.iab.gpp.encoder.section.TcfEuV2; |
18 | | -import com.iab.gpp.encoder.section.UsCaV1; |
19 | | -import com.iab.gpp.encoder.section.UsCoV1; |
20 | | -import com.iab.gpp.encoder.section.UsCtV1; |
21 | | -import com.iab.gpp.encoder.section.UsNatV1; |
22 | | -import com.iab.gpp.encoder.section.UsUtV1; |
23 | | -import com.iab.gpp.encoder.section.UsVaV1; |
| 18 | +import com.iab.gpp.encoder.section.UsCa; |
| 19 | +import com.iab.gpp.encoder.section.UsCo; |
| 20 | +import com.iab.gpp.encoder.section.UsCt; |
| 21 | +import com.iab.gpp.encoder.section.UsFl; |
| 22 | +import com.iab.gpp.encoder.section.UsMt; |
| 23 | +import com.iab.gpp.encoder.section.UsNat; |
| 24 | +import com.iab.gpp.encoder.section.UsOr; |
| 25 | +import com.iab.gpp.encoder.section.UsTx; |
| 26 | +import com.iab.gpp.encoder.section.UsUt; |
| 27 | +import com.iab.gpp.encoder.section.UsVa; |
24 | 28 | import com.iab.gpp.encoder.section.UspV1; |
25 | 29 |
|
26 | 30 | public class GppModel { |
@@ -61,24 +65,36 @@ public void setFieldValue(String sectionName, String fieldName, Object value) { |
61 | 65 | } else if (sectionName.equals(UspV1.NAME)) { |
62 | 66 | section = new UspV1(); |
63 | 67 | this.sections.put(UspV1.NAME, section); |
64 | | - } else if (sectionName.equals(UsNatV1.NAME)) { |
65 | | - section = new UsNatV1(); |
66 | | - this.sections.put(UsNatV1.NAME, section); |
67 | | - } else if (sectionName.equals(UsCaV1.NAME)) { |
68 | | - section = new UsCaV1(); |
69 | | - this.sections.put(UsCaV1.NAME, section); |
70 | | - } else if (sectionName.equals(UsVaV1.NAME)) { |
71 | | - section = new UsVaV1(); |
72 | | - this.sections.put(UsVaV1.NAME, section); |
73 | | - } else if (sectionName.equals(UsCoV1.NAME)) { |
74 | | - section = new UsCoV1(); |
75 | | - this.sections.put(UsCoV1.NAME, section); |
76 | | - } else if (sectionName.equals(UsUtV1.NAME)) { |
77 | | - section = new UsUtV1(); |
78 | | - this.sections.put(UsUtV1.NAME, section); |
79 | | - } else if (sectionName.equals(UsCtV1.NAME)) { |
80 | | - section = new UsCtV1(); |
81 | | - this.sections.put(UsCtV1.NAME, section); |
| 68 | + } else if (sectionName.equals(UsNat.NAME)) { |
| 69 | + section = new UsNat(); |
| 70 | + this.sections.put(UsNat.NAME, section); |
| 71 | + } else if (sectionName.equals(UsCa.NAME)) { |
| 72 | + section = new UsCa(); |
| 73 | + this.sections.put(UsCa.NAME, section); |
| 74 | + } else if (sectionName.equals(UsVa.NAME)) { |
| 75 | + section = new UsVa(); |
| 76 | + this.sections.put(UsVa.NAME, section); |
| 77 | + } else if (sectionName.equals(UsCo.NAME)) { |
| 78 | + section = new UsCo(); |
| 79 | + this.sections.put(UsCo.NAME, section); |
| 80 | + } else if (sectionName.equals(UsUt.NAME)) { |
| 81 | + section = new UsUt(); |
| 82 | + this.sections.put(UsUt.NAME, section); |
| 83 | + } else if (sectionName.equals(UsCt.NAME)) { |
| 84 | + section = new UsCt(); |
| 85 | + this.sections.put(UsCt.NAME, section); |
| 86 | + } else if (sectionName.equals(UsFl.NAME)) { |
| 87 | + section = new UsFl(); |
| 88 | + this.sections.put(UsFl.NAME, section); |
| 89 | + } else if (sectionName.equals(UsMt.NAME)) { |
| 90 | + section = new UsMt(); |
| 91 | + this.sections.put(UsMt.NAME, section); |
| 92 | + } else if (sectionName.equals(UsOr.NAME)) { |
| 93 | + section = new UsOr(); |
| 94 | + this.sections.put(UsOr.NAME, section); |
| 95 | + } else if (sectionName.equals(UsTx.NAME)) { |
| 96 | + section = new UsTx(); |
| 97 | + this.sections.put(UsTx.NAME, section); |
82 | 98 | } |
83 | 99 | } else { |
84 | 100 | section = this.sections.get(sectionName); |
@@ -212,28 +228,44 @@ public UspV1 getUspV1Section() { |
212 | 228 | return (UspV1) getSection(UspV1.NAME); |
213 | 229 | } |
214 | 230 |
|
215 | | - public UsNatV1 getUsNatV1Section() { |
216 | | - return (UsNatV1) getSection(UsNatV1.NAME); |
| 231 | + public UsNat getUsNatSection() { |
| 232 | + return (UsNat) getSection(UsNat.NAME); |
217 | 233 | } |
218 | 234 |
|
219 | | - public UsCaV1 getUsCaV1Section() { |
220 | | - return (UsCaV1) getSection(UsCaV1.NAME); |
| 235 | + public UsCa getUsCaSection() { |
| 236 | + return (UsCa) getSection(UsCa.NAME); |
221 | 237 | } |
222 | 238 |
|
223 | | - public UsVaV1 getUsVaV1Section() { |
224 | | - return (UsVaV1) getSection(UsVaV1.NAME); |
| 239 | + public UsVa getUsVaSection() { |
| 240 | + return (UsVa) getSection(UsVa.NAME); |
225 | 241 | } |
226 | 242 |
|
227 | | - public UsCoV1 getUsCoV1Section() { |
228 | | - return (UsCoV1) getSection(UsCoV1.NAME); |
| 243 | + public UsCo getUsCoSection() { |
| 244 | + return (UsCo) getSection(UsCo.NAME); |
229 | 245 | } |
230 | 246 |
|
231 | | - public UsUtV1 getUsUtV1Section() { |
232 | | - return (UsUtV1) getSection(UsUtV1.NAME); |
| 247 | + public UsUt getUsUtSection() { |
| 248 | + return (UsUt) getSection(UsUt.NAME); |
233 | 249 | } |
234 | 250 |
|
235 | | - public UsCtV1 getUsCtV1Section() { |
236 | | - return (UsCtV1) getSection(UsCtV1.NAME); |
| 251 | + public UsCt getUsCtSection() { |
| 252 | + return (UsCt) getSection(UsCt.NAME); |
| 253 | + } |
| 254 | + |
| 255 | + public UsFl getUsFlSection() { |
| 256 | + return (UsFl) getSection(UsFl.NAME); |
| 257 | + } |
| 258 | + |
| 259 | + public UsMt getUsMtSection() { |
| 260 | + return (UsMt) getSection(UsMt.NAME); |
| 261 | + } |
| 262 | + |
| 263 | + public UsOr getUsOrSection() { |
| 264 | + return (UsOr) getSection(UsOr.NAME); |
| 265 | + } |
| 266 | + |
| 267 | + public UsTx getUsTxSection() { |
| 268 | + return (UsTx) getSection(UsTx.NAME); |
237 | 269 | } |
238 | 270 |
|
239 | 271 | public List<Integer> getSectionIds() { |
@@ -299,24 +331,36 @@ protected Map<String, EncodableSection> decodeModel(String str) { |
299 | 331 | } else if (sectionIds.get(i).equals(UspV1.ID)) { |
300 | 332 | UspV1 section = new UspV1(encodedSections[i + 1]); |
301 | 333 | sections.put(UspV1.NAME, section); |
302 | | - } else if (sectionIds.get(i).equals(UsCaV1.ID)) { |
303 | | - UsCaV1 section = new UsCaV1(encodedSections[i + 1]); |
304 | | - sections.put(UsCaV1.NAME, section); |
305 | | - } else if (sectionIds.get(i).equals(UsNatV1.ID)) { |
306 | | - UsNatV1 section = new UsNatV1(encodedSections[i + 1]); |
307 | | - sections.put(UsNatV1.NAME, section); |
308 | | - } else if (sectionIds.get(i).equals(UsVaV1.ID)) { |
309 | | - UsVaV1 section = new UsVaV1(encodedSections[i + 1]); |
310 | | - sections.put(UsVaV1.NAME, section); |
311 | | - } else if (sectionIds.get(i).equals(UsCoV1.ID)) { |
312 | | - UsCoV1 section = new UsCoV1(encodedSections[i + 1]); |
313 | | - sections.put(UsCoV1.NAME, section); |
314 | | - } else if (sectionIds.get(i).equals(UsUtV1.ID)) { |
315 | | - UsUtV1 section = new UsUtV1(encodedSections[i + 1]); |
316 | | - sections.put(UsUtV1.NAME, section); |
317 | | - } else if (sectionIds.get(i).equals(UsCtV1.ID)) { |
318 | | - UsCtV1 section = new UsCtV1(encodedSections[i + 1]); |
319 | | - sections.put(UsCtV1.NAME, section); |
| 334 | + } else if (sectionIds.get(i).equals(UsCa.ID)) { |
| 335 | + UsCa section = new UsCa(encodedSections[i + 1]); |
| 336 | + sections.put(UsCa.NAME, section); |
| 337 | + } else if (sectionIds.get(i).equals(UsNat.ID)) { |
| 338 | + UsNat section = new UsNat(encodedSections[i + 1]); |
| 339 | + sections.put(UsNat.NAME, section); |
| 340 | + } else if (sectionIds.get(i).equals(UsVa.ID)) { |
| 341 | + UsVa section = new UsVa(encodedSections[i + 1]); |
| 342 | + sections.put(UsVa.NAME, section); |
| 343 | + } else if (sectionIds.get(i).equals(UsCo.ID)) { |
| 344 | + UsCo section = new UsCo(encodedSections[i + 1]); |
| 345 | + sections.put(UsCo.NAME, section); |
| 346 | + } else if (sectionIds.get(i).equals(UsUt.ID)) { |
| 347 | + UsUt section = new UsUt(encodedSections[i + 1]); |
| 348 | + sections.put(UsUt.NAME, section); |
| 349 | + } else if (sectionIds.get(i).equals(UsCt.ID)) { |
| 350 | + UsCt section = new UsCt(encodedSections[i + 1]); |
| 351 | + sections.put(UsCt.NAME, section); |
| 352 | + } else if (sectionIds.get(i).equals(UsFl.ID)) { |
| 353 | + UsFl section = new UsFl(encodedSections[i + 1]); |
| 354 | + sections.put(UsFl.NAME, section); |
| 355 | + } else if (sectionIds.get(i).equals(UsMt.ID)) { |
| 356 | + UsMt section = new UsMt(encodedSections[i + 1]); |
| 357 | + sections.put(UsMt.NAME, section); |
| 358 | + } else if (sectionIds.get(i).equals(UsOr.ID)) { |
| 359 | + UsOr section = new UsOr(encodedSections[i + 1]); |
| 360 | + sections.put(UsOr.NAME, section); |
| 361 | + } else if (sectionIds.get(i).equals(UsTx.ID)) { |
| 362 | + UsTx section = new UsTx(encodedSections[i + 1]); |
| 363 | + sections.put(UsTx.NAME, section); |
320 | 364 | } |
321 | 365 | } |
322 | 366 | } |
@@ -373,24 +417,36 @@ public void decodeSection(String sectionName, String encodedString) { |
373 | 417 | } else if (sectionName.equals(UspV1.NAME)) { |
374 | 418 | section = new UspV1(); |
375 | 419 | this.sections.put(UspV1.NAME, section); |
376 | | - } else if (sectionName.equals(UsNatV1.NAME)) { |
377 | | - section = new UsNatV1(); |
378 | | - this.sections.put(UsNatV1.NAME, section); |
379 | | - } else if (sectionName.equals(UsCaV1.NAME)) { |
380 | | - section = new UsCaV1(); |
381 | | - this.sections.put(UsCaV1.NAME, section); |
382 | | - } else if (sectionName.equals(UsVaV1.NAME)) { |
383 | | - section = new UsVaV1(); |
384 | | - this.sections.put(UsVaV1.NAME, section); |
385 | | - } else if (sectionName.equals(UsCoV1.NAME)) { |
386 | | - section = new UsCoV1(); |
387 | | - this.sections.put(UsCoV1.NAME, section); |
388 | | - } else if (sectionName.equals(UsUtV1.NAME)) { |
389 | | - section = new UsUtV1(); |
390 | | - this.sections.put(UsUtV1.NAME, section); |
391 | | - } else if (sectionName.equals(UsCtV1.NAME)) { |
392 | | - section = new UsCtV1(); |
393 | | - this.sections.put(UsCtV1.NAME, section); |
| 420 | + } else if (sectionName.equals(UsNat.NAME)) { |
| 421 | + section = new UsNat(); |
| 422 | + this.sections.put(UsNat.NAME, section); |
| 423 | + } else if (sectionName.equals(UsCa.NAME)) { |
| 424 | + section = new UsCa(); |
| 425 | + this.sections.put(UsCa.NAME, section); |
| 426 | + } else if (sectionName.equals(UsVa.NAME)) { |
| 427 | + section = new UsVa(); |
| 428 | + this.sections.put(UsVa.NAME, section); |
| 429 | + } else if (sectionName.equals(UsCo.NAME)) { |
| 430 | + section = new UsCo(); |
| 431 | + this.sections.put(UsCo.NAME, section); |
| 432 | + } else if (sectionName.equals(UsUt.NAME)) { |
| 433 | + section = new UsUt(); |
| 434 | + this.sections.put(UsUt.NAME, section); |
| 435 | + } else if (sectionName.equals(UsCt.NAME)) { |
| 436 | + section = new UsCt(); |
| 437 | + this.sections.put(UsCt.NAME, section); |
| 438 | + } else if (sectionName.equals(UsFl.NAME)) { |
| 439 | + section = new UsFl(); |
| 440 | + this.sections.put(UsFl.NAME, section); |
| 441 | + } else if (sectionName.equals(UsMt.NAME)) { |
| 442 | + section = new UsMt(); |
| 443 | + this.sections.put(UsMt.NAME, section); |
| 444 | + } else if (sectionName.equals(UsOr.NAME)) { |
| 445 | + section = new UsOr(); |
| 446 | + this.sections.put(UsOr.NAME, section); |
| 447 | + } else if (sectionName.equals(UsTx.NAME)) { |
| 448 | + section = new UsTx(); |
| 449 | + this.sections.put(UsTx.NAME, section); |
394 | 450 | } |
395 | 451 | } else { |
396 | 452 | section = this.sections.get(sectionName); |
|
0 commit comments