aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dataplanetoken/FingerPrint.java
blob: f5e8f8651f48faa76e2a0f449f6d8a698a6b33de (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
// 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.dataplanetoken;

import ai.vespa.validation.PatternedStringWrapper;

import java.util.regex.Pattern;

/**
 * A fingerprint to be used in dataplane token apis
 */
public class FingerPrint extends PatternedStringWrapper<FingerPrint> {

    static final Pattern namePattern = Pattern.compile("([a-f0-9]{2}:)+[a-f0-9]{2}");

    private FingerPrint(String name) {
        super(name, namePattern, "fingerPrint");
    }

    public static FingerPrint of(String value) {
        return new FingerPrint(value);
    }

}