4finance / micro-infra-spring

Repository containing default microservice infrastructure set up using Spring configuration
Apache License 2.0
203 stars 49 forks source link

Add ability to process received collections directly as List with specified type #401

Open softberries opened 9 years ago

softberries commented 9 years ago

At the moment processing list with ServiceRestClient has to be done with the following

.anObject().ofType(List.class);

This of course is unchecked and in other words sucks. What would be nice is to have smth like this:

andExecuteFor().list().ofType(String)

which would process received list with specified type

softberries commented 9 years ago

This issue is invalid, after further investigation and contacting extraterrestrial forms of life throughtout the night I have found out that its enough if we instead of (eg. for list of strings)

.ofType(List.class)

do

.ofType(String[].class)

:sunglasses:

piotrpietrzak commented 9 years ago

This works with simple types, but we can't do this trick with List [ DTO ] directly. There is an option to use TypeReference, but it needs a lot of work to refactor in a way to make this usable.