Sunday, April 10, 2022

[SOLVED] How I can set Mutiny String variable data into class variable?

Issue

Attached image show the code I have tried I have a method that returns a String amount and I have stored that amount in var1 variable of Mutiny String. I print var1 variable, now I want to set var1 variable in DataMODEL Pojo like DTO class and this class have amount variable. I don't know how I can do this?


Solution

You need to do something like:

@POST
@Path("/filterObject")
public Uni<Response> nameUni(DataMODEL dataMODEL) {
    return dataBaService.getAmountIntoAccount(dataMODEL).onItem().invoke(s -> {
        dataMODEL.amount = s
    });
}


Answered By - geoand
Answer Checked By - Marilyn (WPSolving Volunteer)