Skip to content

Tag: java

Map several fields to List with a mapstruct

for example, I have following entity: And a Dto object: Is there a proper way how to map Bank to BankDto, so employee1 and employee2 fields will be added to employeeList collection? Answer You can resolve your issue by adding an after mapping method to your mapping interface:

Java Flight Recorder – Continuous rolling recording

Question How to get a rolling recording into disk, with a maximum age? Context When something goes bad in my server, I want to be able to dump the profiling information of the hours prior and analyse it, to know what went wrong. As I don’t know when things will go bad, the JDK should be continuously sav…

Finding Index of same element multiple times, Java

I have my code here, I enter a full name with three words, and I need to get the initials of the first two words, Like: Input = Anthony Edward Stark Output = A.E.Stark Pls help me Answer I think this would do the job

Can I delay the onSuccess method in RxJava?

I have SplashScreenFragment and inside this fragment, I’ll load the data from the server using Retrofit with RxJava, Getting data from the server will take between 1 second to 25 seconds. The SplashScreenFragment must show to the user for at least 8 seconds. When I get the data from the server, The onSu…