search

Home  >  Q&A  >  body text

android - java generics do not support arrays, so is there any convenient way for RxJava's Map collection to define and obtain a string of common parent class collection data?

I am using just to send the obtained data (json), and then process the obtained data through map and convert it into a map, and then subscribe,
In the actual process, I found that there are many similar operations, so I want to encapsulate them. I want to use generics for the target collection data obtained in map To stipulate,
But in the process of converting json data to a collection, an array of class objects is needed, and arrays do not support generics. So what is the solution for brothers who encounter similar problems? How to deal with it? Thanks!

PHP中文网PHP中文网2742 days ago668

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-16 13:35:04

    Do I have to use an array? Lists and the like can also be substituted

    reply
    0
  • Cancelreply