View Javadoc
1   /*
2    * Copyright 2017 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.split;
17  
18  import com.opencsv.bean.CsvBindAndSplitByName;
19  import com.opencsv.bean.CsvDate;
20  import java.util.Collection;
21  import java.util.Date;
22  import java.util.Deque;
23  import java.util.LinkedList;
24  import java.util.List;
25  import java.util.NavigableSet;
26  import java.util.Queue;
27  import java.util.Set;
28  import java.util.SortedSet;
29  
30  /**
31   *
32   * @author Andrew Rucker Jones
33   */
34  public class AnnotatedMockBeanCollectionSplit {
35      
36      @CsvBindAndSplitByName(elementType = Integer.class, capture = "couldn't possibly match (anything)")
37      private Collection<Integer> collectionType;
38      
39      @CsvBindAndSplitByName(collectionType = LinkedList.class, elementType = Integer.class, capture = "[a-z]([0-9])")
40      private List<Integer> listType;
41      
42      @CsvBindAndSplitByName(elementType = Date.class)
43      @CsvDate(
44              value = "yyyy-MM-dd",
45              writeFormatEqualsReadFormat = false,
46              writeFormat = "yyyy-MMM-dd",
47              writeChronologyEqualsReadChronology = false,
48              writeChronology = "Japanese")
49      private Set<Date> setType;
50      
51      @CsvBindAndSplitByName(elementType = Integer.class, format = "a%sj")
52      private SortedSet<? extends Number> sortedSetType;
53      
54      @CsvBindAndSplitByName(elementType = Integer.class)
55      private NavigableSet<Integer> navigableSetType;
56      
57      @CsvBindAndSplitByName(elementType = Integer.class)
58      private Queue<Integer> queueType;
59      
60      @CsvBindAndSplitByName(elementType = Integer.class)
61      private Deque<Integer> dequeType;
62  
63      public Collection<Integer> getCollectionType() {
64          return collectionType;
65      }
66  
67      public void setCollectionType(Collection<Integer> collectionType) {
68          this.collectionType = collectionType;
69      }
70  
71      public List<Integer> getListType() {
72          return listType;
73      }
74  
75      public void setListType(List<Integer> listType) {
76          this.listType = listType;
77      }
78  
79      public Set<Date> getSetType() {
80          return setType;
81      }
82  
83      public void setSetType(Set<Date> setType) {
84          this.setType = setType;
85      }
86  
87      public SortedSet<? extends Number> getSortedSetType() {
88          return sortedSetType;
89      }
90  
91      public void setSortedSetType(SortedSet<? extends Number> sortedSetType) {
92          this.sortedSetType = sortedSetType;
93      }
94  
95      public NavigableSet<Integer> getNavigableSetType() {
96          return navigableSetType;
97      }
98  
99      public void setNavigableSetType(NavigableSet<Integer> navigableSetType) {
100         this.navigableSetType = navigableSetType;
101     }
102 
103     public Queue<Integer> getQueueType() {
104         return queueType;
105     }
106 
107     public void setQueueType(Queue<Integer> queueType) {
108         this.queueType = queueType;
109     }
110 
111     public Deque<Integer> getDequeType() {
112         return dequeType;
113     }
114 
115     public void setDequeType(Deque<Integer> dequeType) {
116         this.dequeType = dequeType;
117     }
118 }