blob: 52741a59158319bd1d1abb9aa46aba837bd8bc28 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.noderepository;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yahoo.config.provision.IntRange;
import java.util.OptionalInt;
/**
* @author bratseth
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IntRangeData {
@JsonProperty("from")
public Integer from;
@JsonProperty("to")
public Integer to;
public IntRange toRange() {
return new IntRange(from == null ? OptionalInt.empty() : OptionalInt.of(from),
to == null ? OptionalInt.empty() : OptionalInt.of(to));
}
}
|