I have Spring Data Entity where I get paged result:
classItemsService.findAll(spec, pageable).map(classItemsMapper::toFullDTO);
Using MapStrict framework I filter the values returned from the API:
@Mapper(config = BaseMapperConfig.class)
public interface ClassItemsMapper {
ClassItemsFullDTO toFullDTO(ClassItems classItems);
}
DTO:
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
public class ClassItemsFullDTO {
........
private String productVideo;
........
}
The question is how I can replace second time the values returned from the DB and replacing then with some hardcoded value. For example I suppose that it should be like this:
Page<ClassItemsFullDTO> page = classItemsService.findAll(spec, pageable).map(classItemsMapper::toFullDTO).stream()
.forEach(classItemsFullDTO -> classItemsFullDTO.setProductVideo("unsubscribed"));
Can you help me to fix the issue?
Now I get this issue:
Required type: Page <ClassItemsFullDTO>
Provided: void