1 package com.github.mygreen.supercsv.builder;
2
3 import com.github.mygreen.supercsv.annotation.conversion.CsvFixedSize;
4 import com.github.mygreen.supercsv.cellprocessor.conversion.PaddingProcessor;
5 import com.github.mygreen.supercsv.cellprocessor.conversion.SimplePaddingProcessor;
6
7
8
9
10
11
12
13
14 public class FixedSizeColumnProperty {
15
16 private static final PaddingProcessor DEFAULT_PADDING_PROCESSOR = new SimplePaddingProcessor();
17
18
19
20
21
22
23
24
25
26
27 private final int size;
28
29
30
31
32
33
34 private char padChar = ' ';
35
36
37
38
39
40
41
42 private boolean chopped = false;
43
44
45
46
47 private PaddingProcessor paddingProcessor = DEFAULT_PADDING_PROCESSOR;
48
49
50
51
52
53
54 private boolean rightAlign = false;
55
56
57
58
59
60
61
62 public FixedSizeColumnProperty(int size) {
63 if (size <= 0) {
64 throw new IllegalArgumentException("size shoud be greater than or equals 1 (>=1).");
65 }
66 this.size = size;
67 }
68
69 public int getSize() {
70 return size;
71 }
72
73 public char getPadChar() {
74 return padChar;
75 }
76
77 public void setPadChar(char padChar) {
78 this.padChar = padChar;
79 }
80
81 public boolean isChopped() {
82 return chopped;
83 }
84
85 public void setChopped(boolean chopped) {
86 this.chopped = chopped;
87 }
88
89 public PaddingProcessor getPaddingProcessor() {
90 return paddingProcessor;
91 }
92
93 public void setPaddingProcessor(PaddingProcessor paddingProcessor) {
94 this.paddingProcessor = paddingProcessor;
95 }
96
97 public boolean isRightAlign() {
98 return rightAlign;
99 }
100
101 public void setRightAlign(boolean rightAlign) {
102 this.rightAlign = rightAlign;
103 }
104 }