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

com.yahoo.vespa.hosted.rotation.config.RotationsConfig Maven / Gradle / Ivy

There is a newer version: 8.253.3
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.hosted.rotation.config;

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

/**
 * This class represents the root node of rotations
 *
 * Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 */
public final class RotationsConfig extends ConfigInstance {

  public final static String CONFIG_DEF_MD5 = "879c33cf55526bc351da2a5d53567abf";
  public final static String CONFIG_DEF_NAME = "rotations";
  public final static String CONFIG_DEF_NAMESPACE = "vespa.hosted.rotation.config";
  public final static String CONFIG_DEF_VERSION = "";
  public final static String[] CONFIG_DEF_SCHEMA = {
    "namespace=vespa.hosted.rotation.config",
    "rotations{} string"
  };

  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 static String getDefVersion()   { return CONFIG_DEF_VERSION; }

  public interface Producer extends ConfigInstance.Producer {
    void getConfig(Builder builder);
  }

  public static class Builder implements ConfigInstance.Builder {
    private Set __uninitialized = new HashSet();

    public Map rotations = new LinkedHashMap<>();

    public Builder() { }

    public Builder(RotationsConfig config) {
      rotations(config.rotations());
    }

    private Builder override(Builder __superior) {
      rotations(__superior.rotations);
      return this;
    }

    public Builder rotations(String __key, String __value) {
      rotations.put(__key, __value);
      return this;
    }

    public Builder rotations(Map __values) {
      rotations.putAll(__values);
      return this;
    }

    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 RotationsConfig build() {
      return new RotationsConfig(this);
    }

  }

  private final Map rotations;

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

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

    rotations = LeafNodeMaps.asNodeMap(builder.rotations, new StringNode());
  }

  /**
   * @return rotations.rotations{}
   */
  public Map rotations() {
    return LeafNodeMaps.asValueMap(rotations);
  }

  /**
   * @param key the key of the value to return
   * @return rotations.rotations{}
   */
  public String rotations(String key) {
    return rotations.get(key).value();
  }

  private ChangesRequiringRestart getChangesRequiringRestart(RotationsConfig newConfig) {
    ChangesRequiringRestart changes = new ChangesRequiringRestart("rotations");
    return changes;
  }

  private static boolean containsFieldsFlaggedWithRestart() {
    return false;
  }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy