summaryrefslogtreecommitdiffstats
path: root/config-lib/src/main/java/com/yahoo/config/UrlReference.java
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2018-12-18 10:37:27 +0100
committerLester Solbakken <lesters@oath.com>2018-12-18 10:37:27 +0100
commit7caa60913e4db267f7d7bdfe0e1de90ec12db13f (patch)
treebbb2e77e81d2823fc7c1048a39a7d38c20edfc44 /config-lib/src/main/java/com/yahoo/config/UrlReference.java
parent305d22637387d183be17a0582b1ced76f2b44982 (diff)
Add url config type
Diffstat (limited to 'config-lib/src/main/java/com/yahoo/config/UrlReference.java')
-rwxr-xr-xconfig-lib/src/main/java/com/yahoo/config/UrlReference.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/config-lib/src/main/java/com/yahoo/config/UrlReference.java b/config-lib/src/main/java/com/yahoo/config/UrlReference.java
new file mode 100755
index 00000000000..0ec4fd8f8b8
--- /dev/null
+++ b/config-lib/src/main/java/com/yahoo/config/UrlReference.java
@@ -0,0 +1,40 @@
+// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.config;
+
+import java.util.Objects;
+
+/**
+ * Similar to {@link FileReference}, holds either a URL or a file path to the
+ * downloaded file depending on state.
+ *
+ * @author lesters
+ */
+public final class UrlReference {
+
+ private final String value;
+
+ public UrlReference(String value) {
+ this.value = Objects.requireNonNull(value);
+ }
+
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ return other instanceof UrlReference &&
+ value.equals(((UrlReference)other).value);
+ }
+
+ @Override
+ public String toString() {
+ return "url '" + value + "'";
+ }
+
+}