aboutsummaryrefslogtreecommitdiffstats
path: root/flags/src/main/java/com/yahoo/vespa/flags/UnboundLongFlag.java
blob: 0a8d798e0ddd35e9a0ee296f9386538d7802d00c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.flags;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.LongNode;

/**
 * @author hakonhall
 */
public class UnboundLongFlag extends UnboundFlagImpl<Long, LongFlag, UnboundLongFlag> {
    public UnboundLongFlag(FlagId id, long defaultValue) {
        this(id, defaultValue, new FetchVector());
    }

    public UnboundLongFlag(FlagId id, Long defaultValue, FetchVector defaultFetchVector) {
        super(id, defaultValue, defaultFetchVector,
                new SimpleFlagSerializer<>(LongNode::new, JsonNode::isIntegralNumber, JsonNode::asLong),
                UnboundLongFlag::new, LongFlag::new);
    }
}