How to use List <? extends map <String ,? >>

I am trying to use the constructor of the library that I am using. But I need to pass this object to it:

 List<? extends Map<String, ?>>

But I only have an object:

 data = ArrayList<MyOwnObject>.

I do not understand how I adapt my data for posting in List<? extends Map<String, ?>>.

Thank.

+3
source share
1 answer

Good. This <? extends Whatever>is called a restricted template. It will match yours ArrayList<YourObject>if it YourObjectbelongs to a class that implements Map<String, Something>where it Somethingcan be any class (which will correspond to an unlimited template ?).

ArrayList , List. MyOwnObject, .

.

+4

All Articles