aboutsummaryrefslogtreecommitdiffstats
path: root/config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java b/config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java
new file mode 100644
index 00000000000..e55737da18d
--- /dev/null
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/HostName.java
@@ -0,0 +1,23 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.config.provision;
+
+import ai.vespa.http.DomainName;
+
+import static ai.vespa.validation.Validation.requireLength;
+
+/**
+ * Hostnames match {@link #domainNamePattern}, and are restricted to 64 characters in length.
+ *
+ * @author jonmv
+ */
+public class HostName extends DomainName {
+
+ private HostName(String value) {
+ super(requireLength(value, "hostname length", 1, 64));
+ }
+
+ public static HostName of(String value) {
+ return new HostName(value);
+ }
+
+}