-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add ConfidenceWrapper for OF
- Loading branch information
1 parent
accfb22
commit 7c98857
Showing
21 changed files
with
148 additions
and
141 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
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
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
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
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
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
3 changes: 3 additions & 0 deletions
3
sdk-java/src/main/java/com/spotify/confidence/ConfidenceInstance.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,3 @@ | ||
package com.spotify.confidence; | ||
|
||
public interface ConfidenceInstance extends FlagReader, EventSender {} |
3 changes: 2 additions & 1 deletion
3
sdk-java/src/main/java/com/spotify/confidence/EventSender.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
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
10 changes: 10 additions & 0 deletions
10
sdk-java/src/main/java/com/spotify/confidence/FlagReader.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,10 @@ | ||
package com.spotify.confidence; | ||
|
||
import java.io.Closeable; | ||
|
||
public interface FlagReader extends Closeable { | ||
|
||
<T> T getValue(String key, T defaultValue); | ||
|
||
<T> FlagEvaluation<T> getEvaluation(String key, T defaultValue); | ||
} |
16 changes: 16 additions & 0 deletions
16
sdk-java/src/main/java/com/spotify/confidence/FlagReaderForProvider.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,16 @@ | ||
package com.spotify.confidence; | ||
|
||
import com.spotify.confidence.shaded.flags.resolver.v1.ResolveFlagsResponse; | ||
import java.io.Closeable; | ||
import java.util.Map; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
public interface FlagReaderForProvider extends Contextual, Closeable { | ||
CompletableFuture<ResolveFlagsResponse> resolveFlags(String flagName, String providerId); | ||
|
||
FlagReaderForProvider withContext(ConfidenceValue.Struct context); | ||
|
||
default FlagReaderForProvider withContext(Map<String, ConfidenceValue> context) { | ||
return withContext(ConfidenceValue.Struct.of(context)); | ||
} | ||
} |
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
7 changes: 6 additions & 1 deletion
7
sdk-java/src/main/java/com/spotify/confidence/FlagResolverClient.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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package com.spotify.confidence; | ||
|
||
import com.spotify.confidence.ConfidenceValue.Struct; | ||
import com.spotify.confidence.shaded.flags.resolver.v1.ResolveFlagsResponse; | ||
import java.io.Closeable; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
interface FlagResolverClient extends Closeable { | ||
CompletableFuture<ResolveFlagsResponse> resolveFlags( | ||
String flag, ConfidenceValue.Struct context, Boolean isProvider); | ||
String flag, Struct context, String providerId); | ||
|
||
default CompletableFuture<ResolveFlagsResponse> resolveFlags(String flag, String providerId) { | ||
return resolveFlags(flag, ConfidenceValue.Struct.builder().build(), providerId); | ||
} | ||
} |
Oops, something went wrong.