aboutsummaryrefslogtreecommitdiffstats
path: root/flags/src/main/java/com/yahoo/vespa/flags/UnboundListFlag.java
blob: 3905c3fab5e56bdaa20a36e8e8b28f05ec93ef93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. 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;

/**
 * @author freva
 */
public class UnboundListFlag<T> extends UnboundFlagImpl<List<T>, ListFlag<T>, UnboundListFlag<T>> {
    public UnboundListFlag(FlagId id, List<T> defaultValue, Class<T> clazz) {
        this(id, defaultValue, clazz, new FetchVector());
    }

    public UnboundListFlag(FlagId id, List<T> defaultValue, Class<T> clazz, FetchVector defaultFetchVector) {
        super(id, defaultValue, defaultFetchVector,
                new JacksonArraySerializer<T>(clazz),
                (flagId, defVal, fetchVector) -> new UnboundListFlag<>(flagId, defVal, clazz, fetchVector),
                ListFlag::new);
    }
}