Created
April 17, 2021 15:19
-
-
Save zivce/437ffbfe4597d7e5e971ffe027aa646d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optional<String> defaultStoreStatus = Optional.of("Store not found."); | |
public Optional<String> fetchStoreStatus(int storeId) { | |
Optional<String> foundStore = ... ; // fetch declared store status by id | |
if (foundStore.isPresent()) | |
return foundStore; | |
else | |
return defaultStoreStatus; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment