All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.vespa.testrunner.JunitTestRunnerConfig Maven / Gradle / Ivy

There is a newer version: 8.411.13
Show newest version
/**
 * This file is generated from a config definition file.
 * ------------   D O   N O T   E D I T !   ------------
 */

package com.yahoo.vespa.testrunner;

import java.util.*;
import java.io.File;
import java.nio.file.Path;
import com.yahoo.config.*;

/**
 * This class represents the root node of junit-test-runner
 *
 * Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 */
public final class JunitTestRunnerConfig extends ConfigInstance {

  public final static String CONFIG_DEF_MD5 = "8e2a1625fe65a288fe3d67f2f9d3292f";
  public final static String CONFIG_DEF_NAME = "junit-test-runner";
  public final static String CONFIG_DEF_NAMESPACE = "com.yahoo.vespa.testrunner";
  public final static String[] CONFIG_DEF_SCHEMA = {
    "package=com.yahoo.vespa.testrunner",
    "artifactsPath path",
    "useAthenzCredentials 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 class Builder implements ConfigInstance.Builder {
    private Set __uninitialized = new HashSet(Arrays.asList(
      "artifactsPath"
      ));

    private FileReference artifactsPath = null;
    private Boolean useAthenzCredentials = null;

    public Builder() { }

    public Builder(JunitTestRunnerConfig config) {
      artifactsPath(config.artifactsPath.getFileReference());
      useAthenzCredentials(config.useAthenzCredentials());
    }

    private Builder override(Builder __superior) {
      if (__superior.artifactsPath != null)
        artifactsPath(__superior.artifactsPath);
      if (__superior.useAthenzCredentials != null)
        useAthenzCredentials(__superior.useAthenzCredentials);
      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 useAthenzCredentials(boolean __value) {
      useAthenzCredentials = __value;
      return this;
    }

    private Builder useAthenzCredentials(String __value) {
      return useAthenzCredentials(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 JunitTestRunnerConfig build() {
      return new JunitTestRunnerConfig(this);
    }

  }

  private final PathNode artifactsPath;
  private final BooleanNode useAthenzCredentials;

  public JunitTestRunnerConfig(Builder builder) {
    this(builder, true);
  }

  private JunitTestRunnerConfig(Builder builder, boolean throwIfUninitialized) {
    if (throwIfUninitialized && ! builder.__uninitialized.isEmpty())
      throw new IllegalArgumentException("The following builder parameters for " +
          "junit-test-runner must be initialized: " + builder.__uninitialized);

    artifactsPath = (builder.artifactsPath == null) ?
        new PathNode() : new PathNode(builder.artifactsPath);
    useAthenzCredentials = (builder.useAthenzCredentials == null) ?
        new BooleanNode(false) : new BooleanNode(builder.useAthenzCredentials);
  }

  /**
   * @return junit-test-runner.artifactsPath
   */
  public Path artifactsPath() {
    return artifactsPath.value();
  }

  /**
   * @return junit-test-runner.useAthenzCredentials
   */
  public boolean useAthenzCredentials() {
    return useAthenzCredentials.value();
  }

  private ChangesRequiringRestart getChangesRequiringRestart(JunitTestRunnerConfig newConfig) {
    ChangesRequiringRestart changes = new ChangesRequiringRestart("junit-test-runner");
    return changes;
  }

  private static boolean containsFieldsFlaggedWithRestart() {
    return false;
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy