@Mapping(from = ServerCpu.class, to = Cpu.class) public static Cpu map(ServerCpu entity, Cpu template) { Cpu model = template != null ? template : new Cpu(); model.setName(entity.getCpuName()); model.setLevel(entity.getLevel()); model.setArchitecture(map(entity.getArchitecture(), null)); return model; }
to.setLevel(from.getLevel());