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

ai.vespa.metricsproxy.rpc.RpcConnectorConfig Maven / Gradle / Ivy

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

package ai.vespa.metricsproxy.rpc;

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

/**
 * This class represents the root node of rpc-connector
 *
 * Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 */
public final class RpcConnectorConfig extends ConfigInstance {

  public final static String CONFIG_DEF_MD5 = "96c077bfc867554218c38b2501bdd192";
  public final static String CONFIG_DEF_NAME = "rpc-connector";
  public final static String CONFIG_DEF_NAMESPACE = "ai.vespa.metricsproxy.rpc";
  public final static String[] CONFIG_DEF_SCHEMA = {
    "package=ai.vespa.metricsproxy.rpc",
    "port int"
  };

  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(List.of(
      "port"
      ));

    private Integer port = null;

    public Builder() { }

    public Builder(RpcConnectorConfig config) {
      port(config.port());
    }

    private Builder override(Builder __superior) {
      if (__superior.port != null)
        port(__superior.port);
      return this;
    }

    public Builder port(int __value) {
      port = __value;
      __uninitialized.remove("port");
      return this;
    }

    private Builder port(String __value) {
      return port(Integer.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 RpcConnectorConfig build() {
      return new RpcConnectorConfig(this);
    }

  }

  private final IntegerNode port;

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

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

    port = (builder.port == null) ?
        new IntegerNode() : new IntegerNode(builder.port);
  }

  /**
   * @return rpc-connector.port
   */
  public int port() {
    return port.value();
  }

  private ChangesRequiringRestart getChangesRequiringRestart(RpcConnectorConfig newConfig) {
    ChangesRequiringRestart changes = new ChangesRequiringRestart("rpc-connector");
    return changes;
  }

  private static boolean containsFieldsFlaggedWithRestart() {
    return false;
  }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy