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 GoodJoinByPositionAnnotationsForWriting {
30
31 @CsvBindAndJoinByPosition(position = "0", elementType = Integer.class, required = true, format = "?%s?")
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)
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 GoodJoinByPositionAnnotationsForWriting() {
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 public MultiValuedMap<Integer, Date> getMap2() {
61 return map2;
62 }
63
64 public void setMap2(MultiValuedMap<Integer, Date> map2) {
65 this.map2 = map2;
66 }
67
68 public MultiValuedMap<Integer, Integer> getMap3() {
69 return map3;
70 }
71
72 public void setMap3(MultiValuedMap<Integer, Integer> map3) {
73 this.map3 = map3;
74 }
75
76 public ArrayListValuedHashMap<Integer, String> getMap4() {
77 return map4;
78 }
79
80 public void setMap4(ArrayListValuedHashMap<Integer, String> map4) {
81 this.map4 = map4;
82 }
83
84 public MultiValuedMap<Integer, Integer> getMap5() {
85 return map5;
86 }
87
88 public void setMap5(MultiValuedMap<Integer, Integer> map5) {
89 this.map5 = map5;
90 }
91
92 }