diff options
Diffstat (limited to 'config-lib/src/main/java/com/yahoo/config/UrlReference.java')
-rwxr-xr-x | config-lib/src/main/java/com/yahoo/config/UrlReference.java | 40 |
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 + "'"; + } + +} |