-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: circular calling on
GetResponse::found
Adds a new interface `GetResponseFound` to solve the previous implementation's circular calling on `GetResponse::found`. Previously this method returned a `GetResponse.Found`, so on a response of this type, a caller could write `response.found().get().found().get().found()...` ad infinitum. This was not desirable. To solve this we introduce a new interface `GetResponseFound` which `GetResponse.Found` implements. This way `GetResponse::found` returns an `Optional.of` an object implementing that, which cuts the cycle.
- Loading branch information
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
5 changes: 5 additions & 0 deletions
5
momento-sdk/src/main/java/momento/sdk/responses/storage/GetResponseFound.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package momento.sdk.responses.storage; | ||
|
||
public interface GetResponseFound { | ||
StorageValue value(); | ||
} |