Skip to content

Commit cc59acb

Browse files
committed
Fix type conversion example
1 parent 7d394a0 commit cc59acb

File tree

1 file changed

+8
-4
lines changed
  • framework-docs/modules/ROOT/pages/core/validation

1 file changed

+8
-4
lines changed

framework-docs/modules/ROOT/pages/core/validation/convert.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,11 @@ Java::
316316
317317
List<Integer> input = ...
318318
cs.convert(input,
319-
TypeDescriptor.forObject(input), // List<Integer> type descriptor
320-
TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(String.class)));
319+
TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(Integer.class)), // <1>
320+
TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(String.class))); // <2>
321321
----
322+
<1> `List<Integer>` type descriptor
323+
<2> `List<String>` type descriptor
322324
323325
Kotlin::
324326
+
@@ -328,9 +330,11 @@ Kotlin::
328330
329331
val input: List<Integer> = ...
330332
cs.convert(input,
331-
TypeDescriptor.forObject(input), // List<Integer> type descriptor
332-
TypeDescriptor.collection(List::class.java, TypeDescriptor.valueOf(String::class.java)))
333+
TypeDescriptor.collection(List::class.java, TypeDescriptor.valueOf(Integer::class.java)), // <1>
334+
TypeDescriptor.collection(List::class.java, TypeDescriptor.valueOf(String::class.java))) // <2>
333335
----
336+
<1> `List<Integer>` type descriptor
337+
<2> `List<String>` type descriptor
334338
======
335339

336340
Note that `DefaultConversionService` automatically registers converters that are

0 commit comments

Comments
 (0)