3333 */
3434public class PgRow implements Row {
3535
36- final DataRow data ;
37- final DataConverter dataConverter ;
38- final Map <String , PgColumn > columns ;
39- final PgColumn [] pgColumns ;
36+ private final DataRow data ;
37+ private final DataConverter dataConverter ;
38+ private final Map <String , PgColumn > columns ;
39+ private final PgColumn [] pgColumns ;
4040
41- public PgRow (DataRow data , Map <String , PgColumn > columns , DataConverter dataConverter ) {
41+ PgRow (DataRow data , Map <String , PgColumn > columns , DataConverter dataConverter ) {
4242 this .data = data ;
4343 this .dataConverter = dataConverter ;
4444 this .columns = columns ;
@@ -47,190 +47,190 @@ public PgRow(DataRow data, Map<String, PgColumn> columns, DataConverter dataConv
4747
4848 @ Override
4949 public String getString (int index ) {
50- return dataConverter .toString (pgColumns [index ].type , data .getValue (index ));
50+ return dataConverter .toString (pgColumns [index ].getType () , data .getValue (index ));
5151 }
5252
5353 @ Override
5454 public String getString (String column ) {
5555 PgColumn pgColumn = getColumn (column );
56- return dataConverter .toString (pgColumn .type , data .getValue (pgColumn .index ));
56+ return dataConverter .toString (pgColumn .getType () , data .getValue (pgColumn .at () ));
5757 }
5858
5959 @ Override
6060 public Character getChar (int index ) {
61- return dataConverter .toChar (pgColumns [index ].type , data .getValue (index ));
61+ return dataConverter .toChar (pgColumns [index ].getType () , data .getValue (index ));
6262 }
6363
6464 @ Override
6565 public Character getChar (String column ) {
6666 PgColumn pgColumn = getColumn (column );
67- return dataConverter .toChar (pgColumn .type , data .getValue (pgColumn .index ));
67+ return dataConverter .toChar (pgColumn .getType () , data .getValue (pgColumn .at () ));
6868 }
6969
7070 @ Override
7171 public Byte getByte (int index ) {
72- return dataConverter .toByte (pgColumns [index ].type , data .getValue (index ));
72+ return dataConverter .toByte (pgColumns [index ].getType () , data .getValue (index ));
7373 }
7474
7575 @ Override
7676 public Byte getByte (String column ) {
7777 PgColumn pgColumn = getColumn (column );
78- return dataConverter .toByte (pgColumn .type , data .getValue (pgColumn .index ));
78+ return dataConverter .toByte (pgColumn .getType () , data .getValue (pgColumn .at () ));
7979 }
8080
8181 @ Override
8282 public Short getShort (int index ) {
83- return dataConverter .toShort (pgColumns [index ].type , data .getValue (index ));
83+ return dataConverter .toShort (pgColumns [index ].getType () , data .getValue (index ));
8484 }
8585
8686 @ Override
8787 public Short getShort (String column ) {
8888 PgColumn pgColumn = getColumn (column );
89- return dataConverter .toShort (pgColumn .type , data .getValue (pgColumn .index ));
89+ return dataConverter .toShort (pgColumn .getType () , data .getValue (pgColumn .at () ));
9090 }
9191
9292 @ Override
9393 public Integer getInt (int index ) {
94- return dataConverter .toInteger (pgColumns [index ].type , data .getValue (index ));
94+ return dataConverter .toInteger (pgColumns [index ].getType () , data .getValue (index ));
9595 }
9696
9797 @ Override
9898 public Integer getInt (String column ) {
9999 PgColumn pgColumn = getColumn (column );
100- return dataConverter .toInteger (pgColumn .type , data .getValue (pgColumn .index ));
100+ return dataConverter .toInteger (pgColumn .getType () , data .getValue (pgColumn .at () ));
101101 }
102102
103103 @ Override
104104 public Long getLong (int index ) {
105- return dataConverter .toLong (pgColumns [index ].type , data .getValue (index ));
105+ return dataConverter .toLong (pgColumns [index ].getType () , data .getValue (index ));
106106 }
107107
108108 @ Override
109109 public Long getLong (String column ) {
110110 PgColumn pgColumn = getColumn (column );
111- return dataConverter .toLong (pgColumn .type , data .getValue (pgColumn .index ));
111+ return dataConverter .toLong (pgColumn .getType () , data .getValue (pgColumn .at () ));
112112 }
113113
114114 @ Override
115115 public BigInteger getBigInteger (int index ) {
116- return dataConverter .toBigInteger (pgColumns [index ].type , data .getValue (index ));
116+ return dataConverter .toBigInteger (pgColumns [index ].getType () , data .getValue (index ));
117117 }
118118
119119 @ Override
120120 public BigInteger getBigInteger (String column ) {
121121 PgColumn pgColumn = getColumn (column );
122- return dataConverter .toBigInteger (pgColumn .type , data .getValue (pgColumn .index ));
122+ return dataConverter .toBigInteger (pgColumn .getType () , data .getValue (pgColumn .at () ));
123123 }
124124
125125 @ Override
126126 public BigDecimal getBigDecimal (int index ) {
127- return dataConverter .toBigDecimal (pgColumns [index ].type , data .getValue (index ));
127+ return dataConverter .toBigDecimal (pgColumns [index ].getType () , data .getValue (index ));
128128 }
129129
130130 @ Override
131131 public BigDecimal getBigDecimal (String column ) {
132132 PgColumn pgColumn = getColumn (column );
133- return dataConverter .toBigDecimal (pgColumn .type , data .getValue (pgColumn .index ));
133+ return dataConverter .toBigDecimal (pgColumn .getType () , data .getValue (pgColumn .at () ));
134134 }
135135
136136 @ Override
137137 public Double getDouble (int index ) {
138- return dataConverter .toDouble (pgColumns [index ].type , data .getValue (index ));
138+ return dataConverter .toDouble (pgColumns [index ].getType () , data .getValue (index ));
139139 }
140140
141141 @ Override
142142 public Double getDouble (String column ) {
143143 PgColumn pgColumn = getColumn (column );
144- return dataConverter .toDouble (pgColumn .type , data .getValue (pgColumn .index ));
144+ return dataConverter .toDouble (pgColumn .getType () , data .getValue (pgColumn .at () ));
145145 }
146146
147147 @ Override
148148 public Date getDate (int index ) {
149- return dataConverter .toDate (pgColumns [index ].type , data .getValue (index ));
149+ return dataConverter .toDate (pgColumns [index ].getType () , data .getValue (index ));
150150 }
151151
152152 @ Override
153153 public Date getDate (String column ) {
154154 PgColumn pgColumn = getColumn (column );
155- return dataConverter .toDate (pgColumn .type , data .getValue (pgColumn .index ));
155+ return dataConverter .toDate (pgColumn .getType () , data .getValue (pgColumn .at () ));
156156 }
157157
158158 @ Override
159159 public Time getTime (int index ) {
160- return dataConverter .toTime (pgColumns [index ].type , data .getValue (index ));
160+ return dataConverter .toTime (pgColumns [index ].getType () , data .getValue (index ));
161161 }
162162
163163 @ Override
164164 public Time getTime (String column ) {
165165 PgColumn pgColumn = getColumn (column );
166- return dataConverter .toTime (pgColumn .type , data .getValue (pgColumn .index ));
166+ return dataConverter .toTime (pgColumn .getType () , data .getValue (pgColumn .at () ));
167167 }
168168
169169 @ Override
170170 public Timestamp getTimestamp (String column ) {
171171 PgColumn pgColumn = getColumn (column );
172- return dataConverter .toTimestamp (pgColumn .type , data .getValue (pgColumn .index ));
172+ return dataConverter .toTimestamp (pgColumn .getType () , data .getValue (pgColumn .at () ));
173173 }
174174
175175 @ Override
176176 public Timestamp getTimestamp (int index ) {
177- return dataConverter .toTimestamp (pgColumns [index ].type , data .getValue (index ));
177+ return dataConverter .toTimestamp (pgColumns [index ].getType () , data .getValue (index ));
178178 }
179179
180180 @ Override
181181 public byte [] getBytes (int index ) {
182- return dataConverter .toBytes (pgColumns [index ].type , data .getValue (index ));
182+ return dataConverter .toBytes (pgColumns [index ].getType () , data .getValue (index ));
183183 }
184184
185185 @ Override
186186 public byte [] getBytes (String column ) {
187187 PgColumn pgColumn = getColumn (column );
188- return dataConverter .toBytes (pgColumn .type , data .getValue (pgColumn .index ));
188+ return dataConverter .toBytes (pgColumn .getType () , data .getValue (pgColumn .at () ));
189189 }
190190
191191 @ Override
192192 public Boolean getBoolean (int index ) {
193- return dataConverter .toBoolean (pgColumns [index ].type , data .getValue (index ));
193+ return dataConverter .toBoolean (pgColumns [index ].getType () , data .getValue (index ));
194194 }
195195
196196 @ Override
197197 public Boolean getBoolean (String column ) {
198198 PgColumn pgColumn = getColumn (column );
199- return dataConverter .toBoolean (pgColumn .type , data .getValue (pgColumn .index ));
199+ return dataConverter .toBoolean (pgColumn .getType () , data .getValue (pgColumn .at () ));
200200 }
201201
202202 @ Override
203203 public <TArray > TArray getArray (String column , Class <TArray > arrayType ) {
204204 PgColumn pgColumn = getColumn (column );
205- return dataConverter .toArray (arrayType , pgColumn .type , data .getValue (pgColumn .index ));
205+ return dataConverter .toArray (arrayType , pgColumn .getType () , data .getValue (pgColumn .at () ));
206206 }
207207
208208 @ Override
209209 public <TArray > TArray getArray (int index , Class <TArray > arrayType ) {
210- return dataConverter .toArray (arrayType , pgColumns [index ].type , data .getValue (index ));
210+ return dataConverter .toArray (arrayType , pgColumns [index ].getType () , data .getValue (index ));
211211 }
212212
213213 @ Override
214214 public <T > T get (int index , Class <T > type ) {
215- return dataConverter .toObject (type , pgColumns [index ].type , data .getValue (index ));
215+ return dataConverter .toObject (type , pgColumns [index ].getType () , data .getValue (index ));
216216 }
217217
218218 @ Override
219219 public <T > T get (String column , Class <T > type ) {
220220 PgColumn pgColumn = getColumn (column );
221- return dataConverter .toObject (type , pgColumn .type , data .getValue (pgColumn .index ));
221+ return dataConverter .toObject (type , pgColumn .getType () , data .getValue (pgColumn .at () ));
222222 }
223223
224224 public Object get (String column ) {
225225 PgColumn pgColumn = getColumn (column );
226- return dataConverter .toObject (pgColumn .type , data .getValue (pgColumn .index ));
226+ return dataConverter .toObject (pgColumn .getType () , data .getValue (pgColumn .at () ));
227227 }
228228
229229 public Map <String , PgColumn > getColumns () {
230230 return columns ;
231231 }
232232
233- PgColumn getColumn (String name ) {
233+ private PgColumn getColumn (String name ) {
234234 if (name == null ) {
235235 throw new IllegalArgumentException ("Column name is required" );
236236 }
0 commit comments