Package com.yahoo.config.model.api
Interface ModelFactory
-
public interface ModelFactory
Factory for config models.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ModelCreateResult
createAndValidateModel(ModelContext modelContext, ValidationParameters validationParameters)
Creates an instance of aModel
.Model
createModel(ModelContext modelContext)
Creates an instance of aModel
.com.yahoo.component.Version
version()
Returns the Vespa version of the models this builds.
-
-
-
Method Detail
-
version
com.yahoo.component.Version version()
Returns the Vespa version of the models this builds.- Returns:
- the version of a
Model
instance that this factory can create.
-
createModel
Model createModel(ModelContext modelContext)
Creates an instance of aModel
. The resulting instance will be used to serve config. No model validation will be done, calling this method assumes thatcreateAndValidateModel(ModelContext, ValidationParameters)
has already been called at some point for this model.- Parameters:
modelContext
- an instance ofModelContext
, containing dependencies for creating aModel
.- Returns:
- a
Model
instance.
-
createAndValidateModel
ModelCreateResult createAndValidateModel(ModelContext modelContext, ValidationParameters validationParameters)
Creates an instance of aModel
. The resulting instance will be used to serve config. Any validation of aModel
and theModelContext
can be done in this method.- Parameters:
modelContext
- an instance ofModelContext
, containing dependencies for creating aModel
validationParameters
- validation parameters- Returns:
- a
ModelCreateResult
instance.
-
-