// We need map Human.name to HumanDto.fullName, but if Human.name == null, then set value "Somebody"
// we can use defaultValue() or defaultExpression() for it
@Mapper
public interface HumanMapper {
@Mapping(source="name", target="name", defaultValue="Somebody")
HumanDto toHumanDto(Human human)
}
Расскажите пожалуйста что за класс Application в строке
Не слышал, чтоб называли World Wide War
Обычно World War I или World War II смотря про какую речь была)
Здесь ошибка. defaultValue устанавливает значение, если source == null, а если нужно вне зависимости от условий - это constant.
Пример как использовать defaultValue из javaDoc'a https://mapstruct.org/documentation/1.6/api/org/mapstruct/Mapping.html#defaultValue()