-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup: use pojo instead of triconsumer
Signed-off-by: Todd Baert <[email protected]>
- Loading branch information
Showing
8 changed files
with
1,346 additions
and
1,219 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
68 changes: 68 additions & 0 deletions
68
...rc/main/java/dev/openfeature/contrib/providers/flagd/resolver/common/ConnectionEvent.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,68 @@ | ||
package dev.openfeature.contrib.providers.flagd.resolver.common; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
/** | ||
* Event payload for a | ||
* {@link dev.openfeature.contrib.providers.flagd.resolver.Resolver} connection | ||
* state change event. | ||
*/ | ||
@AllArgsConstructor | ||
public class ConnectionEvent { | ||
@Getter | ||
private final boolean connected; | ||
private final List<String> flagsChanged; | ||
private final Map<String, Object> syncMetadata; | ||
|
||
/** | ||
* Construct a new ConnectionEvent. | ||
* | ||
* @param connected status of the connection | ||
*/ | ||
public ConnectionEvent(boolean connected) { | ||
this(connected, Collections.emptyList(), Collections.emptyMap()); | ||
} | ||
|
||
/** | ||
* Construct a new ConnectionEvent. | ||
* | ||
* @param connected status of the connection | ||
* @param flagsChanged list of flags changed | ||
*/ | ||
public ConnectionEvent(boolean connected, List<String> flagsChanged) { | ||
this(connected, flagsChanged, Collections.emptyMap()); | ||
} | ||
|
||
/** | ||
* Construct a new ConnectionEvent. | ||
* | ||
* @param connected status of the connection | ||
* @param syncMetadata sync.getMetadata | ||
*/ | ||
public ConnectionEvent(boolean connected, Map<String, Object> syncMetadata) { | ||
this(connected, Collections.emptyList(), syncMetadata); | ||
} | ||
|
||
/** | ||
* Get changed flags. | ||
* | ||
* @return an unmodifiable view of the changed flags | ||
*/ | ||
public List<String> getFlagsChanged() { | ||
return Collections.unmodifiableList(flagsChanged); | ||
} | ||
|
||
/** | ||
* Get changed sync metadata. | ||
* | ||
* @return an unmodifiable view of the sync metadata | ||
*/ | ||
public Map<String, Object> getSyncMetadata() { | ||
return Collections.unmodifiableMap(syncMetadata); | ||
} | ||
} |
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
Oops, something went wrong.