|
30 | 30 |
|
31 | 31 | import org.springframework.core.convert.converter.Converter;
|
32 | 32 | import org.springframework.core.convert.converter.ConverterFactory;
|
33 |
| -import org.springframework.data.r2dbc.convert.R2dbcConverters.RowToNumberConverterFactory.RowToOffsetDateTimeConverter; |
34 |
| -import org.springframework.data.r2dbc.convert.R2dbcConverters.RowToNumberConverterFactory.RowToStringConverter; |
35 |
| -import org.springframework.data.r2dbc.convert.R2dbcConverters.RowToNumberConverterFactory.RowToUuidConverter; |
36 |
| -import org.springframework.data.r2dbc.convert.R2dbcConverters.RowToNumberConverterFactory.RowToZonedDateTimeConverter; |
37 | 33 | import org.springframework.util.Assert;
|
38 | 34 | import org.springframework.util.NumberUtils;
|
39 | 35 |
|
|
42 | 38 | *
|
43 | 39 | * @author Hebert Coelho
|
44 | 40 | * @author Mark Paluch
|
| 41 | + * @author Valeriy Vyrva |
45 | 42 | */
|
46 | 43 | abstract class R2dbcConverters {
|
47 | 44 |
|
@@ -169,66 +166,66 @@ public T convert(Row source) {
|
169 | 166 | return (object != null ? NumberUtils.convertNumberToTargetClass((Number) object, this.targetType) : null);
|
170 | 167 | }
|
171 | 168 | }
|
| 169 | + } |
172 | 170 |
|
173 |
| - /** |
174 |
| - * Simple singleton to convert {@link Row}s to their {@link OffsetDateTime} representation. |
175 |
| - * |
176 |
| - * @author Hebert Coelho |
177 |
| - */ |
178 |
| - public enum RowToOffsetDateTimeConverter implements Converter<Row, OffsetDateTime> { |
| 171 | + /** |
| 172 | + * Simple singleton to convert {@link Row}s to their {@link OffsetDateTime} representation. |
| 173 | + * |
| 174 | + * @author Hebert Coelho |
| 175 | + */ |
| 176 | + public enum RowToOffsetDateTimeConverter implements Converter<Row, OffsetDateTime> { |
179 | 177 |
|
180 |
| - INSTANCE; |
| 178 | + INSTANCE; |
181 | 179 |
|
182 |
| - @Override |
183 |
| - public OffsetDateTime convert(Row row) { |
184 |
| - return row.get(0, OffsetDateTime.class); |
185 |
| - } |
| 180 | + @Override |
| 181 | + public OffsetDateTime convert(Row row) { |
| 182 | + return row.get(0, OffsetDateTime.class); |
186 | 183 | }
|
| 184 | + } |
187 | 185 |
|
188 |
| - /** |
189 |
| - * Simple singleton to convert {@link Row}s to their {@link String} representation. |
190 |
| - * |
191 |
| - * @author Hebert Coelho |
192 |
| - */ |
193 |
| - public enum RowToStringConverter implements Converter<Row, String> { |
| 186 | + /** |
| 187 | + * Simple singleton to convert {@link Row}s to their {@link String} representation. |
| 188 | + * |
| 189 | + * @author Hebert Coelho |
| 190 | + */ |
| 191 | + public enum RowToStringConverter implements Converter<Row, String> { |
194 | 192 |
|
195 |
| - INSTANCE; |
| 193 | + INSTANCE; |
196 | 194 |
|
197 |
| - @Override |
198 |
| - public String convert(Row row) { |
199 |
| - return row.get(0, String.class); |
200 |
| - } |
| 195 | + @Override |
| 196 | + public String convert(Row row) { |
| 197 | + return row.get(0, String.class); |
201 | 198 | }
|
| 199 | + } |
202 | 200 |
|
203 |
| - /** |
204 |
| - * Simple singleton to convert {@link Row}s to their {@link UUID} representation. |
205 |
| - * |
206 |
| - * @author Hebert Coelho |
207 |
| - */ |
208 |
| - public enum RowToUuidConverter implements Converter<Row, UUID> { |
| 201 | + /** |
| 202 | + * Simple singleton to convert {@link Row}s to their {@link UUID} representation. |
| 203 | + * |
| 204 | + * @author Hebert Coelho |
| 205 | + */ |
| 206 | + public enum RowToUuidConverter implements Converter<Row, UUID> { |
209 | 207 |
|
210 |
| - INSTANCE; |
| 208 | + INSTANCE; |
211 | 209 |
|
212 |
| - @Override |
213 |
| - public UUID convert(Row row) { |
214 |
| - return row.get(0, UUID.class); |
215 |
| - } |
| 210 | + @Override |
| 211 | + public UUID convert(Row row) { |
| 212 | + return row.get(0, UUID.class); |
216 | 213 | }
|
| 214 | + } |
217 | 215 |
|
218 |
| - /** |
219 |
| - * Simple singleton to convert {@link Row}s to their {@link ZonedDateTime} representation. |
220 |
| - * |
221 |
| - * @author Hebert Coelho |
222 |
| - */ |
223 |
| - public enum RowToZonedDateTimeConverter implements Converter<Row, ZonedDateTime> { |
| 216 | + /** |
| 217 | + * Simple singleton to convert {@link Row}s to their {@link ZonedDateTime} representation. |
| 218 | + * |
| 219 | + * @author Hebert Coelho |
| 220 | + */ |
| 221 | + public enum RowToZonedDateTimeConverter implements Converter<Row, ZonedDateTime> { |
224 | 222 |
|
225 |
| - INSTANCE; |
| 223 | + INSTANCE; |
226 | 224 |
|
227 |
| - @Override |
228 |
| - public ZonedDateTime convert(Row row) { |
229 |
| - return row.get(0, ZonedDateTime.class); |
230 |
| - } |
| 225 | + @Override |
| 226 | + public ZonedDateTime convert(Row row) { |
| 227 | + return row.get(0, ZonedDateTime.class); |
231 | 228 | }
|
232 |
| - |
233 | 229 | }
|
| 230 | + |
234 | 231 | }
|
0 commit comments