Search in sources :

Example 1 with TodoListDAOConverter

use of de.djuelg.neuronizer.storage.converter.TodoListDAOConverter in project Neuronizer by djuelg.

the class TodoListRepositoryImpl method getTodoListById.

@Override
public Optional<TodoList> getTodoListById(String uuid) {
    Realm realm = Realm.getInstance(configuration);
    Optional<TodoListDAO> todoListDAO = Optional.fromNullable(realm.where(TodoListDAO.class).equalTo("uuid", uuid).findFirst());
    Optional<TodoList> todoList = todoListDAO.transform(new TodoListDAOConverter());
    realm.close();
    return todoList;
}
Also used : TodoListDAOConverter(de.djuelg.neuronizer.storage.converter.TodoListDAOConverter) Realm(io.realm.Realm) TodoListDAO(de.djuelg.neuronizer.storage.model.TodoListDAO) TodoList(de.djuelg.neuronizer.domain.model.preview.TodoList)

Aggregations

TodoList (de.djuelg.neuronizer.domain.model.preview.TodoList)1 TodoListDAOConverter (de.djuelg.neuronizer.storage.converter.TodoListDAOConverter)1 TodoListDAO (de.djuelg.neuronizer.storage.model.TodoListDAO)1 Realm (io.realm.Realm)1