1 package com.opencsv.bean.mocks.profile;
2
3 import com.opencsv.bean.*;
4 import com.opencsv.bean.customconverter.ConvertFrenchToBoolean;
5 import com.opencsv.bean.customconverter.ConvertGermanToBoolean;
6 import org.apache.commons.collections4.MultiValuedMap;
7
8 import java.time.LocalDate;
9 import java.util.LinkedList;
10 import java.util.List;
11 import java.util.Stack;
12
13 public class ProfileNameMock {
14
15 @CsvBindByName
16 @CsvBindByName(capture = "integer: ([0-9]+)", format = "integer: %s", profiles = {"profile 1"})
17 @CsvBindByName(capture = "int ([0-9]+) value", format = "int %s value", profiles = {"profile 2"})
18 private int int1;
19
20 @CsvCustomBindByNames({
21 @CsvCustomBindByName(converter = ConvertGermanToBoolean.class, profiles = {"profile 1", "profile 2"}),
22 @CsvCustomBindByName(converter = ConvertFrenchToBoolean.class, profiles = {"", "profile 3"})
23 })
24 private boolean bool1;
25
26 @CsvBindAndSplitByName(elementType = Float.class)
27 @CsvNumber("#0.0#'%'")
28 @CsvBindAndSplitByNames({
29 @CsvBindAndSplitByName(elementType = Float.class, collectionType = LinkedList.class, profiles = "profile 1"),
30 @CsvBindAndSplitByName(elementType = Float.class, collectionType = Stack.class, profiles = "profile 2")
31 })
32 @CsvNumbers({
33 @CsvNumber(value = "#0.000#", profiles = "profile 1"),
34 @CsvNumber(value = "0.0#E0", profiles = "profile 2")
35 })
36 private List<Float> floats;
37
38 @CsvBindAndJoinByNames({
39 @CsvBindAndJoinByName(elementType = LocalDate.class),
40 @CsvBindAndJoinByName(
41 elementType = LocalDate.class,
42 profiles = {"profile 1", "profile 2", "profile 3"},
43 column = "date.*")
44 })
45 @CsvDates({
46 @CsvDate("MM/dd/yyyy"),
47 @CsvDate(value = "dd. MMMM yyyy", profiles = {"profile 1", "profile 2", "profile 3"})
48 })
49 private MultiValuedMap<String, LocalDate> dates;
50
51 @CsvIgnore(profiles = "profile 2")
52 @CsvBindByName(column = "stringy string", profiles = "profile 2")
53 @CsvBindByName(profiles = "profile 3")
54 private String string1;
55
56 @CsvIgnore
57 @CsvBindByName(column = "stringy string", profiles = "profile 2")
58 @CsvBindByName(profiles = "profile 3")
59 private String string2;
60
61 public int getInt1() {
62 return int1;
63 }
64
65 public void setInt1(int int1) {
66 this.int1 = int1;
67 }
68
69 public boolean isBool1() {
70 return bool1;
71 }
72
73 public void setBool1(boolean bool1) {
74 this.bool1 = bool1;
75 }
76
77 public List<Float> getFloats() {
78 return floats;
79 }
80
81 public void setFloats(List<Float> floats) {
82 this.floats = floats;
83 }
84
85 public MultiValuedMap<String, LocalDate> getDates() {
86 return dates;
87 }
88
89 public void setDates(MultiValuedMap<String, LocalDate> dates) {
90 this.dates = dates;
91 }
92
93 public String getString1() {
94 return string1;
95 }
96
97 public void setString1(String string1) {
98 this.string1 = string1;
99 }
100
101 public String getString2() {
102 return string2;
103 }
104
105 public void setString2(String string2) {
106 this.string2 = string2;
107 }
108 }