diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java index 2ffc24239f9..9fdaaff9d5e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java @@ -313,6 +313,7 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Seri * @param configId the config id * @return a config instance of the given type */ + @Override public <CONFIGTYPE extends ConfigInstance> CONFIGTYPE getConfig(Class<CONFIGTYPE> clazz, String configId) { try { ConfigInstance.Builder builder = newBuilder(clazz); @@ -393,6 +394,7 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Seri * @param targetDef The config definition to use for the schema * @return The payload as a list of strings */ + @Deprecated // TODO: Remove after December 2020 @Override public ConfigPayload getConfig(ConfigKey<?> configKey, com.yahoo.vespa.config.buildergen.ConfigDefinition targetDef) { Objects.requireNonNull(targetDef, "config definition cannot be null"); @@ -405,6 +407,19 @@ public final class VespaModel extends AbstractConfigProducerRoot implements Seri } /** + * Resolve config for a given key and config definition + * + * @param configKey the key to resolve. + * @param targetDef the config definition to use for the schema + * @return the resolved config instance + */ + @Override + public ConfigInstance.Builder getConfigInstance(ConfigKey<?> configKey, com.yahoo.vespa.config.buildergen.ConfigDefinition targetDef) { + Objects.requireNonNull(targetDef, "config definition cannot be null"); + return resolveToBuilder(configKey); + } + + /** * Resolves the given config key into a correctly typed ConfigBuilder * and fills in the config from this model. * |