1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.opencsv.bean.mocks.join;
17
18 import com.opencsv.bean.CsvBindAndJoinByPosition;
19 import com.opencsv.bean.CsvDate;
20 import java.util.Date;
21 import org.apache.commons.collections4.MultiValuedMap;
22 import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;
23 import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
24
25
26
27
28
29 public class GoodJoinByPositionAnnotations {
30
31 @CsvBindAndJoinByPosition(position = "0", elementType = Integer.class, required = true, capture = "couldn't possibly match (anything)")
32 private MultiValuedMap<Integer, Integer> map1;
33
34 @CsvBindAndJoinByPosition(position = "1,16-", elementType = Date.class, locale = "de-DE", required = true)
35 @CsvDate(value = "dd. MMM yyyy")
36 private MultiValuedMap<Integer, Date> map2;
37
38 @CsvBindAndJoinByPosition(position = "3-2", elementType = Integer.class, mapType = HashSetValuedHashMap.class, capture = "\\|([0-9]+)\\|")
39 private MultiValuedMap<Integer, Integer> map3;
40
41 @CsvBindAndJoinByPosition(position = "4-6 , 7 - 9,8-10,12,13,15", elementType = String.class)
42 private ArrayListValuedHashMap<Integer, String> map4;
43
44 @CsvBindAndJoinByPosition(position = "11", elementType = Integer.class, locale = "de")
45 private MultiValuedMap<Integer, Integer> map5;
46
47 public GoodJoinByPositionAnnotations() {
48 map1 = new ArrayListValuedHashMap<>();
49 map1.put(Integer.MAX_VALUE, Integer.MIN_VALUE);
50 }
51
52 public MultiValuedMap<Integer, Integer> getMap1() {
53 return map1;
54 }
55
56 public void setMap1(MultiValuedMap<Integer, Integer> map1) {
57 this.map1 = map1;
58 }
59
60
61
62
63
64 public MultiValuedMap<Integer, Date> showMeTheSecondMap() {
65 return map2;
66 }
67
68 public void setMap2(MultiValuedMap<Integer, Date> map2) {
69 this.map2 = map2;
70 }
71
72 public MultiValuedMap<Integer, Integer> getMap3() {
73 return map3;
74 }
75
76
77
78
79
80
81 public ArrayListValuedHashMap<Integer, String> getMap4() {
82 return map4;
83 }
84
85 public void setMap4(ArrayListValuedHashMap<Integer, String> map4) {
86 this.map4 = map4;
87 }
88
89 public MultiValuedMap<Integer, Integer> getMap5() {
90 return map5;
91 }
92
93 public void setMap5(MultiValuedMap<Integer, Integer> map5) {
94 this.map5 = map5;
95 }
96
97 }