Package com.yahoo.config
Class ModelReference
java.lang.Object
com.yahoo.config.ModelReference
An immutable reference to a model.
This is a file path when read by a client but is set in a config instance either as a
path, url or id resolved to an url during deployment.
- Author:
- bratseth
-
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanReturns whether this is already resolved.modelId()Returns the id specified for this model, oor null if it is resolved.path()Returns the path specified for this model, or null if it is resolved.static ModelReferenceCreates a resolved reference.static ModelReferenceresolved(Path path, UrlReference url) Creates a resolved reference where the original URI path is kept.Returns the secret reference specified for this model, or null if it is resolved.toString()Returns this on the format accepted by valueOf NB!static ModelReferenceunresolved(FileReference path) Creates an unresolved reference from a path only.static ModelReferenceunresolved(UrlReference url) Creates an unresolved reference from an url only.static ModelReferenceunresolved(String modelId) Creates an unresolved reference from a model id only.static ModelReferenceunresolved(Optional<String> modelId, Optional<UrlReference> url, Optional<FileReference> path) Creates an unresolved reference.static ModelReferenceunresolved(Optional<String> modelId, Optional<UrlReference> url, Optional<String> secretRef, Optional<FileReference> path) Creates an unresolved reference with an optional secret.url()Returns the url specified for this model, or null if it is resolved.value()Returns the path to the file containing this model, or null if this is unresolved.static ModelReferenceCreates a model reference which is either a single string with no spaces if resolved, or if unresolved a four-part string on the formmodelId url secretRef path, where each of the elements is either a value not containing space, or empty represented by "".
-
Method Details
-
isResolved
public boolean isResolved()Returns whether this is already resolved. -
modelId
Returns the id specified for this model, oor null if it is resolved. -
url
Returns the url specified for this model, or null if it is resolved. -
path
Returns the path specified for this model, or null if it is resolved. -
secretRef
Returns the secret reference specified for this model, or null if it is resolved. -
value
Returns the path to the file containing this model, or null if this is unresolved. -
equals
-
hashCode
public int hashCode() -
toString
Returns this on the format accepted by valueOf NB! Any changes to this format must be reflected in valueOf below and must be backwards compatible -
valueOf
Creates a model reference which is either a single string with no spaces if resolved, or if unresolved a four-part string on the formmodelId url secretRef path, where each of the elements is either a value not containing space, or empty represented by "". NB! Any changes to this format must be reflected in toString above and must be backwards compatible -
unresolved
Creates an unresolved reference from a model id only. -
unresolved
Creates an unresolved reference from an url only. -
unresolved
Creates an unresolved reference from a path only. -
unresolved
public static ModelReference unresolved(Optional<String> modelId, Optional<UrlReference> url, Optional<FileReference> path) Creates an unresolved reference. -
unresolved
public static ModelReference unresolved(Optional<String> modelId, Optional<UrlReference> url, Optional<String> secretRef, Optional<FileReference> path) Creates an unresolved reference with an optional secret. -
resolved
Creates a resolved reference. -
resolved
Creates a resolved reference where the original URI path is kept.
-