Skip to content

Instantly share code, notes, and snippets.

@schroedermatt
Created April 4, 2022 20:38
Show Gist options
  • Save schroedermatt/89a3a72b942b8229c968caf164c21a0c to your computer and use it in GitHub Desktop.
Save schroedermatt/89a3a72b942b8229c968caf164c21a0c to your computer and use it in GitHub Desktop.
// two topics that this consumer cares about
List assignedTopics = ["demo.topic.one", "demo.topic.two"]
// all of the feature flags
List flags = [
"topic_demo.topic.one",
"ui-feature-flag",
"topic_important.topic"
]
// the flags that this consumer actually cares about
List assignedTopicFlags = toggles
.stream()
.filter(t -> t.startsWith('topic_') && assignedTopics.contains(getTopicName(t))
.collect(toList());
// assignedTopicFlags = ["topic_demo.topic.one"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment