View Javadoc
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.CsvBindByPosition;
19  import org.apache.commons.lang3.builder.EqualsBuilder;
20  
21  /**
22   *
23   * @author Andrew Rucker Jones
24   */
25  public class MinimalCsvBindByPositionBeanForWriting {
26      
27      @CsvBindByPosition(position = 1)
28      private int b;
29      
30      @CsvBindByPosition(position = 2)
31      private int c;
32      
33      @CsvBindByPosition(position = 3)
34      private int a;
35  
36      public int getB() {
37          return b;
38      }
39  
40      public void setB(int b) {
41          this.b = b;
42      }
43  
44      public int getC() {
45          return c;
46      }
47  
48      public void setC(int c) {
49          this.c = c;
50      }
51  
52      public int getA() {
53          return a;
54      }
55  
56      public void setA(int a) {
57          this.a = a;
58      }
59  
60      @Override
61      public boolean equals(Object obj) {
62          if(obj == null) {return false;}
63          if(obj == this) {return true;}
64          if(obj.getClass() != getClass()) {return false;}
65          MinimalCsvBindByPositionBeanForWriting rhs = (MinimalCsvBindByPositionBeanForWriting) obj;
66          return new EqualsBuilder()
67                  .append(a, rhs.a)
68                  .append(b, rhs.b)
69                  .append(c, rhs.c)
70                  .isEquals();
71      }
72  }