@Override
public Optional<NoteDetails> getValue() {
if(!lastDetails.isPresent()) {
return Optional.absent();
}
NoteDetails last = lastDetails.get();
NoteHeader header = last.getNoteHeader();
NoteContent.Builder contentBuilder = NoteContent.builder();
contentBuilder.setNoteType(NoteType.COMMENT);
contentBuilder.setBody(editorPanel.getBody());
NoteContent content = contentBuilder.build();
return Optional.of(new NoteDetails(header, content));
}