1 /*
2 * Copyright 2016 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;
17
18 import com.opencsv.bean.CsvBindByName;
19 import com.opencsv.bean.CsvBindByPosition;
20
21 /**
22 * A derived class with one additional field to test mapping with inheritance.
23 * @author Andrew Rucker Jones
24 */
25 public class AnnotatedMockBeanFullDerived extends AnnotatedMockBeanFull {
26
27 /**
28 * Field for annotation tests.
29 * <p>Used for the following test cases, reading:</p>
30 * <ul>
31 * <li>{@link com.opencsv.bean.AnnotationTest#testGoodDerivedDataByName()}</li>
32 * <li>{@link com.opencsv.bean.AnnotationTest#testGoodDerivedDataByPosition()}</li>
33 * </ul>
34 * <p>Used for the following test cases, writing:</p>
35 * <ul>
36 * <li>Writing a subclass with annotations in the subclass and the superclass</li>
37 * <li>Specifying a superclass, but writing a subclass</li>
38 * </ul>
39 */
40 @CsvBindByName(required = true, column = "int in subclass")
41 @CsvBindByPosition(required = true, position = 52)
42 private int intInSubclass;
43
44 public int getIntInSubclass() {
45 return intInSubclass;
46 }
47
48 public void setIntInSubclass(int intInSubclass) {
49 this.intInSubclass = intInSubclass;
50 }
51 }