aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/routing/rotation/Rotation.java
blob: ea97b1da4de72f1f96d84ae446f9c1a0b450cc4c (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
30
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.routing.rotation;

import com.yahoo.text.Text;

import java.util.Objects;

/**
 * Represents a global routing rotation.
 *
 * @author mpolden
 */
public record Rotation(RotationId id, String name) {

    public Rotation {
        Objects.requireNonNull(id);
        Objects.requireNonNull(name);
    }

    /** The ID of the allocated rotation. This value is generated by global routing system */
    public RotationId id() {
        return id;
    }

    /** The global rotation FQDN */
    public String name() {
        return name;
    }

    @Override
    public String toString() {
        return Text.format("rotation %s -> %s", id().asString(), name());
    }

}