Skip to content
Snippets Groups Projects
Commit 0352b922 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5044 Refactored in SettingService

parent 9bc6c8e8
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,6 @@ class SettingService {
private PostfachSettingBody getSettingWithPostfachFromDb() {
var postfach = repository.findOneByName(POSTFACH_SETTING_ITEM_NAME);
return postfach.isPresent() ? (PostfachSettingBody) postfach.get().getSettingBody() : PostfachSettingBody.builder().build();
return postfach.map(Setting::getSettingBody).map(PostfachSettingBody.class::cast).orElse(PostfachSettingBody.builder().build());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment