@@ -48,7 +48,7 @@ public InMemoryProvider(Map<String, Flag<?>> flags) {
48
48
}
49
49
50
50
/**
51
- * Initialize the provider.
51
+ * Initializes the provider.
52
52
* @param evaluationContext evaluation context
53
53
* @throws Exception on error
54
54
*/
@@ -60,8 +60,10 @@ public void initialize(EvaluationContext evaluationContext) throws Exception {
60
60
}
61
61
62
62
/**
63
- * Updating provider flags configuration, replacing existing flags.
64
- * @param newFlags the flags to use instead of the previous flags.
63
+ * Updates the provider flags configuration.
64
+ * For existing flags, the new configurations replace the old one.
65
+ * For new flags, they are added to the configuration.
66
+ * @param newFlags the new flag configurations
65
67
*/
66
68
public void updateFlags (Map <String , Flag <?>> newFlags ) {
67
69
Set <String > flagsChanged = new HashSet <>(newFlags .keySet ());
@@ -76,11 +78,13 @@ public void updateFlags(Map<String, Flag<?>> newFlags) {
76
78
}
77
79
78
80
/**
79
- * Updating provider flags configuration with adding or updating a flag.
80
- * @param flag the flag to update. If a flag with this key already exists, new flag replaces it.
81
+ * Updates a single provider flag configuration.
82
+ * For existing flag, the new configuration replaces the old one.
83
+ * For new flag, they are added to the configuration.
84
+ * @param newFlag the flag to update
81
85
*/
82
- public void updateFlag (String flagKey , Flag <?> flag ) {
83
- this .flags .put (flagKey , flag );
86
+ public void updateFlag (String flagKey , Flag <?> newFlag ) {
87
+ this .flags .put (flagKey , newFlag );
84
88
ProviderEventDetails details = ProviderEventDetails .builder ()
85
89
.flagsChanged (Collections .singletonList (flagKey ))
86
90
.message ("flag added/updated" )
0 commit comments