src/main/java/com/danielezihe/controllers/ToDoController.java
/**
     * Creates and adds a new Todo to the todos BidiMap.
     * @param title Title of the todo
     * @param description Description of the Todo
     * @return the just created {@link ToDoEntity} todo
     */
Creates and adds a new Todo to the todos BidiMap.
@param title Title of the todo
@param description Description of the Todo
@return the just created  ToDoEntity todo
Creates and adds a new Todo to the todos BidiMap . @param title Title of the todo @param description Description of the Todo @return the just created ToDoEntity todo
public ToDoEntity createNewTodo(String title, String description) {
        int id = todos.size() + 1;
        Calendar calendar = Calendar.getInstance(Locale.UK);
        long createdAt = calendar.getTimeInMillis();
        ToDoEntity newTodo = new ToDoEntity(id, title, description, ToDoStatus.ACTIVE, createdAt);
        todos.put(id, newTodo);
        return newTodo;
    }
public ToDoEntity createNewTodo ( String title , String description ) { int id = todos . size ( ) + 1 ; Calendar calendar = Calendar . getInstance ( Locale . UK ) ; long createdAt = calendar . getTimeInMillis ( ) ; ToDoEntity newTodo = new ToDoEntity ( id , title , description , ToDoStatus . ACTIVE , createdAt ) ; todos . put ( id , newTodo ) ; return newTodo ; }
Creates and adds a new Todo to the todos BidiMap.
Creates and adds a new Todo to the todos BidiMap .
// long createdAt = Timestamp.from(Instant.now()).getTime();