aboutsummaryrefslogtreecommitdiffstats
path: root/flags/src/main/java/com/yahoo/vespa/flags/UnboundDoubleFlag.java
blob: c3adfeb0014b6e16c24554b68aad9a86c59233d2 (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 com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.DoubleNode;

/**
 * @author freva
 */
public class UnboundDoubleFlag extends UnboundFlagImpl<Double, DoubleFlag, UnboundDoubleFlag> {
    public UnboundDoubleFlag(FlagId id, double defaultValue) {
        this(id, defaultValue, new FetchVector());
    }

    public UnboundDoubleFlag(FlagId id, Double defaultValue, FetchVector defaultFetchVector) {
        super(id, defaultValue, defaultFetchVector,
                new SimpleFlagSerializer<>(DoubleNode::new, JsonNode::isFloatingPointNumber, JsonNode::asDouble),
                UnboundDoubleFlag::new, DoubleFlag::new);
    }
}