Add withListFlag() to InMemoryFlagSource
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.flags;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
@@ -40,6 +41,10 @@ public class InMemoryFlagSource implements FlagSource {
return withRawFlag(flagId, new UnboundJacksonFlag<>(flagId, value, jacksonClass).serializer().serialize(value));
}
+ public <T> InMemoryFlagSource withListFlag(FlagId flagId, List<T> value) {
+ return withRawFlag(flagId, new UnboundListFlag<T>(flagId, value).serializer().serialize(value));
+ }
+
public InMemoryFlagSource removeFlag(FlagId flagId) {
rawFlagsById.remove(flagId);
return this;
