1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.imaging.formats.jpeg.iptc;
19
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 public class PhotoshopApp13Data {
25 private final List<IptcRecord> records;
26 private final List<IptcBlock> rawBlocks;
27
28 public PhotoshopApp13Data(final List<IptcRecord> records, final List<IptcBlock> rawBlocks) {
29 this.rawBlocks = rawBlocks == null ? Collections.emptyList() : Collections.unmodifiableList(rawBlocks);
30 this.records = records == null ? Collections.emptyList() : Collections.unmodifiableList(records);
31 }
32
33 public List<IptcBlock> getNonIptcBlocks() {
34 final List<IptcBlock> result = new ArrayList<>();
35 for (final IptcBlock block : rawBlocks) {
36 if (!block.isIptcBlock()) {
37 result.add(block);
38 }
39 }
40 return result;
41 }
42
43 public List<IptcBlock> getRawBlocks() {
44 return new ArrayList<>(rawBlocks);
45 }
46
47 public List<IptcRecord> getRecords() {
48 return new ArrayList<>(records);
49 }
50
51 }