You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we can create mapstruct method only with one parameter, that will become receiver in extension function. I think it would be great, if we could create methods with additional parameters. First parameter as receiver of extension function and others as input parameters.
Example:
data classEmployeeModel(valfirstName:String)
data classEmployeeCompanyView(valfirstName:String, valcompany:String)
@Mappings(
Mapping(target ="company", source ="company")
)
abstractfuntoEmployeeCompanyView(employeeModel:EmployeeModel, company:String): EmployeeCompanyView
Compiled to:
fun EmployeeModel.toEmployeeCompanyView(company:String) =Mappers.getMapper(EmployeeMapper::class.java).toEmployeeCompanyView(this, company)
So we can call:
val model =EmployeeModel("Alex")
val view = model.toEmployeeCompanyView("amazon")
The text was updated successfully, but these errors were encountered:
Now we can create mapstruct method only with one parameter, that will become receiver in extension function. I think it would be great, if we could create methods with additional parameters. First parameter as receiver of extension function and others as input parameters.
Example:
Compiled to:
So we can call:
The text was updated successfully, but these errors were encountered: