Search in sources :

Example 1 with TodoListItemDAOConverter

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

the class TodoListRepositoryImpl method getItemById.

@Override
public Optional<TodoListItem> getItemById(String uuid) {
    Realm realm = Realm.getInstance(configuration);
    Optional<TodoListItemDAO> itemDAO = Optional.fromNullable(realm.where(TodoListItemDAO.class).equalTo("uuid", uuid).findFirst());
    Optional<TodoListItem> item = itemDAO.transform(new TodoListItemDAOConverter());
    realm.close();
    return item;
}
Also used : TodoListItemDAOConverter(de.djuelg.neuronizer.storage.converter.TodoListItemDAOConverter) Realm(io.realm.Realm) TodoListItem(de.djuelg.neuronizer.domain.model.todolist.TodoListItem) TodoListItemDAO(de.djuelg.neuronizer.storage.model.TodoListItemDAO)

Aggregations

TodoListItem (de.djuelg.neuronizer.domain.model.todolist.TodoListItem)1 TodoListItemDAOConverter (de.djuelg.neuronizer.storage.converter.TodoListItemDAOConverter)1 TodoListItemDAO (de.djuelg.neuronizer.storage.model.TodoListItemDAO)1 Realm (io.realm.Realm)1