diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-11-08 11:11:11 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-11-08 11:11:11 +0100 |
commit | 5046ad6259251bdaa5b03fb9cb367306150e2153 (patch) | |
tree | 13a6a7c4277fc7ec58b3825a56e95094d48d5a63 /config-lib/src/main | |
parent | 45000a2bf0f388d768c4791b3d06ff007096579a (diff) |
Tolerate attempts to resolve multiple times
Diffstat (limited to 'config-lib/src/main')
-rw-r--r-- | config-lib/src/main/java/com/yahoo/config/ModelReference.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config-lib/src/main/java/com/yahoo/config/ModelReference.java b/config-lib/src/main/java/com/yahoo/config/ModelReference.java index 25caad55b84..fbf34c7ff23 100644 --- a/config-lib/src/main/java/com/yahoo/config/ModelReference.java +++ b/config-lib/src/main/java/com/yahoo/config/ModelReference.java @@ -32,13 +32,16 @@ public class ModelReference { this.resolved = resolved; } + /** Returns whether this is already resolved. */ + public boolean isResolved() { return resolved != null; } + /** Returns the id specified for this model, oor null if it is resolved. */ public Optional<String> modelId() { return modelId; } /** Returns the url specified for this model, or null if it is resolved. */ public Optional<UrlReference> url() { return url; } - /** Returns the path specified for this model, oor null if it is resolved. */ + /** Returns the path specified for this model, or null if it is resolved. */ public Optional<FileReference> path() { return path; } /** Returns the path to the file containing this model, or null if this is unresolved. */ @@ -109,7 +112,7 @@ public class ModelReference { return new ModelReference(modelId, url, path, null); } - /** Creates a nresolved reference. */ + /** Creates a resolved reference. */ public static ModelReference resolved(Path path) { return new ModelReference(null, null, null, Objects.requireNonNull(path)); } |