Search in sources :

Example 1 with NoteDAOConverter

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

the class NoteRepositoryImpl method get.

@Override
public Optional<Note> get(String uuid) {
    Realm realm = Realm.getInstance(configuration);
    Optional<NoteDAO> noteDAO = Optional.fromNullable(realm.where(NoteDAO.class).equalTo("uuid", uuid).findFirst());
    Optional<Note> note = noteDAO.transform(new NoteDAOConverter());
    realm.close();
    return note;
}
Also used : NoteDAO(de.djuelg.neuronizer.storage.model.NoteDAO) Note(de.djuelg.neuronizer.domain.model.preview.Note) NoteDAOConverter(de.djuelg.neuronizer.storage.converter.NoteDAOConverter) Realm(io.realm.Realm)

Aggregations

Note (de.djuelg.neuronizer.domain.model.preview.Note)1 NoteDAOConverter (de.djuelg.neuronizer.storage.converter.NoteDAOConverter)1 NoteDAO (de.djuelg.neuronizer.storage.model.NoteDAO)1 Realm (io.realm.Realm)1