Converting HashMap to ArrayList

后端 未结 2 1653
忘了有多久
忘了有多久 2020-12-29 01:20

I just want to move the transitionHash map values into the cardholderDataRecords arraylist.

HashMap transitionHash =         


        
2条回答
  •  一生所求
    2020-12-29 01:54

    You're trying to cast the collection of values to a single ExceptionLifeCycleDataBean.

    You can very easily get the list though:

    List beans =
        new ArrayList(transitionHash.values());
    

    Or to add to an existing collection, with:

    cardholderDataRecords.addAll(transitionHash.values());
    

    No casts necessary.

提交回复
热议问题