Skip to content

Commit

Permalink
map from db
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Gorzala committed Jan 21, 2024
1 parent ab98a15 commit 63ee8d3
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ public class StateMapper {

public static State of(StateJpaEntity stateJpaEntity) {
State state = new State();

if (stateJpaEntity
.getData()
.getOptSendlastMessage()
.isPresent()) {
state.setLastMailMessage(stateJpaEntity.getData().getOptSendlastMessage().get());
}
stateJpaEntity.getData().getUnreadChatMessages().stream().forEach(
ucm -> {
state.addUnreadChatMessage(ucm);
}
);
return state;
}
}

0 comments on commit 63ee8d3

Please sign in to comment.