public TaskDto fromTask(Task entity) { TaskDto taskDto = new TaskDto(); Map<String, Object> adapters = new HashMap<String, Object>(); taskDto.setSteps(fromSteps(entity.getSteps())); adapters.put(INT_STR_ADAPTER_NAME, integerAndStringConverter); adapters.put(BOOL_STR_ADAPTER_NAME, booleanAndStringConverter); adapters.put(DATE_STR_ADAPTER_NAME, dateAndStringConverter); taskAssembler.assembleDto(taskDto, entity, adapters, null); return taskDto; }
public Task toTask(TaskDto taskDto) { Task task = new Task(); Map<String, Object> adapters = new HashMap<String, Object>(); adapters.put(INT_STR_ADAPTER_NAME, integerAndStringConverter); adapters.put(BOOL_STR_ADAPTER_NAME, booleanAndStringConverter); adapters.put(DATE_STR_ADAPTER_NAME, dateAndStringConverter); task.setSteps(toSteps(taskDto.getSteps())); taskAssembler.assembleEntity(taskDto, task, adapters, null); return task; }