com.yahoo.vespa.hosted.testrunner.TestRunnerConfig Maven / Gradle / Ivy
/**
* This file is generated from a config definition file.
* ------------ D O N O T E D I T ! ------------
*/
package com.yahoo.vespa.hosted.testrunner;
import java.util.*;
import java.io.File;
import java.nio.file.Path;
import com.yahoo.config.*;
/**
* This class represents the root node of test-runner
*
* Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
*/
public final class TestRunnerConfig extends ConfigInstance {
public final static String CONFIG_DEF_MD5 = "44581f7534fbccf08ee8abf6e2a3982d";
public final static String CONFIG_DEF_NAME = "test-runner";
public final static String CONFIG_DEF_NAMESPACE = "com.yahoo.vespa.hosted.testrunner";
public final static String[] CONFIG_DEF_SCHEMA = {
"package=com.yahoo.vespa.hosted.testrunner",
"artifactsPath path",
"surefireMemoryMb int default=1024",
"useAthenzCredentials bool default=false",
"useTesterCertificate bool default=false"
};
public static String getDefMd5() { return CONFIG_DEF_MD5; }
public static String getDefName() { return CONFIG_DEF_NAME; }
public static String getDefNamespace() { return CONFIG_DEF_NAMESPACE; }
public interface Producer extends ConfigInstance.Producer {
void getConfig(Builder builder);
}
public static final class Builder implements ConfigInstance.Builder {
private Set __uninitialized = new HashSet(Arrays.asList(
"artifactsPath"
));
private FileReference artifactsPath = null;
private Integer surefireMemoryMb = null;
private Boolean useAthenzCredentials = null;
private Boolean useTesterCertificate = null;
public Builder() { }
public Builder(TestRunnerConfig config) {
artifactsPath(config.artifactsPath.getFileReference());
surefireMemoryMb(config.surefireMemoryMb());
useAthenzCredentials(config.useAthenzCredentials());
useTesterCertificate(config.useTesterCertificate());
}
private Builder override(Builder __superior) {
if (__superior.artifactsPath != null)
artifactsPath(__superior.artifactsPath);
if (__superior.surefireMemoryMb != null)
surefireMemoryMb(__superior.surefireMemoryMb);
if (__superior.useAthenzCredentials != null)
useAthenzCredentials(__superior.useAthenzCredentials);
if (__superior.useTesterCertificate != null)
useTesterCertificate(__superior.useTesterCertificate);
return this;
}
public Builder artifactsPath(FileReference __value) {
if (__value == null) throw new IllegalArgumentException("Null value is not allowed.");
artifactsPath = __value;
__uninitialized.remove("artifactsPath");
return this;
}
public Builder surefireMemoryMb(int __value) {
surefireMemoryMb = __value;
return this;
}
private Builder surefireMemoryMb(String __value) {
return surefireMemoryMb(Integer.valueOf(__value));
}
public Builder useAthenzCredentials(boolean __value) {
useAthenzCredentials = __value;
return this;
}
private Builder useAthenzCredentials(String __value) {
return useAthenzCredentials(Boolean.valueOf(__value));
}
public Builder useTesterCertificate(boolean __value) {
useTesterCertificate = __value;
return this;
}
private Builder useTesterCertificate(String __value) {
return useTesterCertificate(Boolean.valueOf(__value));
}
private boolean _applyOnRestart = false;
@java.lang.Override
public final boolean dispatchGetConfig(ConfigInstance.Producer producer) {
if (producer instanceof Producer) {
((Producer)producer).getConfig(this);
return true;
}
return false;
}
@java.lang.Override
public final String getDefMd5() { return CONFIG_DEF_MD5; }
@java.lang.Override
public final String getDefName() { return CONFIG_DEF_NAME; }
@java.lang.Override
public final String getDefNamespace() { return CONFIG_DEF_NAMESPACE; }
@java.lang.Override
public final boolean getApplyOnRestart() { return _applyOnRestart; }
@java.lang.Override
public final void setApplyOnRestart(boolean applyOnRestart) { _applyOnRestart = applyOnRestart; }
public TestRunnerConfig build() {
return new TestRunnerConfig(this);
}
}
private final PathNode artifactsPath;
private final IntegerNode surefireMemoryMb;
private final BooleanNode useAthenzCredentials;
private final BooleanNode useTesterCertificate;
public TestRunnerConfig(Builder builder) {
this(builder, true);
}
private TestRunnerConfig(Builder builder, boolean throwIfUninitialized) {
if (throwIfUninitialized && ! builder.__uninitialized.isEmpty())
throw new IllegalArgumentException("The following builder parameters for " +
"test-runner must be initialized: " + builder.__uninitialized);
artifactsPath = (builder.artifactsPath == null) ?
new PathNode() : new PathNode(builder.artifactsPath);
surefireMemoryMb = (builder.surefireMemoryMb == null) ?
new IntegerNode(1024) : new IntegerNode(builder.surefireMemoryMb);
useAthenzCredentials = (builder.useAthenzCredentials == null) ?
new BooleanNode(false) : new BooleanNode(builder.useAthenzCredentials);
useTesterCertificate = (builder.useTesterCertificate == null) ?
new BooleanNode(false) : new BooleanNode(builder.useTesterCertificate);
}
/**
* @return test-runner.artifactsPath
*/
public Path artifactsPath() {
return artifactsPath.value();
}
/**
* @return test-runner.surefireMemoryMb
*/
public int surefireMemoryMb() {
return surefireMemoryMb.value();
}
/**
* @return test-runner.useAthenzCredentials
*/
public boolean useAthenzCredentials() {
return useAthenzCredentials.value();
}
/**
* @return test-runner.useTesterCertificate
*/
public boolean useTesterCertificate() {
return useTesterCertificate.value();
}
private ChangesRequiringRestart getChangesRequiringRestart(TestRunnerConfig newConfig) {
ChangesRequiringRestart changes = new ChangesRequiringRestart("test-runner");
return changes;
}
private static boolean containsFieldsFlaggedWithRestart() {
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy