View Javadoc
1   /*
2    * Copyright 2018 Andrew Rucker Jones.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.opencsv.bean.mocks.join;
17  
18  import com.opencsv.bean.CsvBindAndJoinByName;
19  import com.opencsv.bean.CsvDate;
20  import java.util.Date;
21  import org.apache.commons.collections4.MultiValuedMap;
22  
23  /**
24   *
25   * @author Andrew Rucker Jones
26   */
27  public class GoodJoinByNameAnnotations {
28      
29      @CsvBindAndJoinByName(column = "index", elementType = Integer.class, required = true, capture = "couldn't possibly match (anything)")
30      private MultiValuedMap<String, Integer> map1;
31      
32      @CsvBindAndJoinByName(column = "date[0-9]", elementType = Date.class, locale = "de-DE", required = true)
33      @CsvDate(value = "dd. MMMM yyyy")
34      private MultiValuedMap<String, Date> map2;
35      
36      @CsvBindAndJoinByName(column = "regular expression will never match", elementType = String.class)
37      private MultiValuedMap<String, String> map3;
38      
39      @CsvBindAndJoinByName(column = "conversion", elementType = Integer.class, locale = "de", capture = "(.*)x", format = "x%s")
40      private MultiValuedMap<String, Integer> map4;
41  
42      public MultiValuedMap<String, Integer> getMap1() {
43          return map1;
44      }
45  
46      public void setMap1(MultiValuedMap<String, Integer> map1) {
47          this.map1 = map1;
48      }
49  
50      public MultiValuedMap<String, Date> getMap2() {
51          return map2;
52      }
53  
54      public void setMap2(MultiValuedMap<String, Date> map2) {
55          this.map2 = map2;
56      }
57  
58      public MultiValuedMap<String, String> getMap3() {
59          return map3;
60      }
61  
62      public void setMap3(MultiValuedMap<String, String> map3) {
63          this.map3 = map3;
64      }
65  
66      public MultiValuedMap<String, Integer> getMap4() {
67          return map4;
68      }
69  
70      public void setMap4(MultiValuedMap<String, Integer> map4) {
71          this.map4 = map4;
72      }
73  }