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

org.glowroot.central.ImmutableCentralConfiguration Maven / Gradle / Ivy

There is a newer version: 0.14.0-beta.3
Show newest version
package org.glowroot.central;

import com.datastax.driver.core.ConsistencyLevel;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.primitives.Booleans;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.Var;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.immutables.value.Generated;

/**
 * Immutable implementation of {@link CentralModule.CentralConfiguration}.
 * 

* Use the builder to create immutable instances: * {@code ImmutableCentralConfiguration.builder()}. */ @Generated(from = "CentralModule.CentralConfiguration", generator = "Immutables") @SuppressWarnings({"all"}) @ParametersAreNonnullByDefault @javax.annotation.Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue final class ImmutableCentralConfiguration extends CentralModule.CentralConfiguration { private final ImmutableList cassandraContactPoint; private final int cassandraPort; private final String cassandraUsername; private final String cassandraPassword; private final boolean cassandraSSL; private final String cassandraKeyspace; private final ConsistencyLevel cassandraReadConsistencyLevel; private final ConsistencyLevel cassandraWriteConsistencyLevel; private transient final String cassandraConsistencyLevelDisplay; private final String cassandraSymmetricEncryptionKey; private final int cassandraMaxConcurrentQueries; private final int cassandraPoolTimeoutMillis; private final String grpcBindAddress; private final java.lang.@Nullable Integer grpcHttpPort; private final java.lang.@Nullable Integer grpcHttpsPort; private final String uiBindAddress; private final int uiPort; private final boolean uiHttps; private final String uiContextPath; private final ImmutableMap jgroupsProperties; private ImmutableCentralConfiguration(ImmutableCentralConfiguration.Builder builder) { this.jgroupsProperties = builder.jgroupsProperties.build(); if (builder.cassandraContactPointIsSet()) { initShim.cassandraContactPoint(builder.cassandraContactPoint.build()); } if (builder.cassandraPortIsSet()) { initShim.cassandraPort(builder.cassandraPort); } if (builder.cassandraUsername != null) { initShim.cassandraUsername(builder.cassandraUsername); } if (builder.cassandraPassword != null) { initShim.cassandraPassword(builder.cassandraPassword); } if (builder.cassandraSSLIsSet()) { initShim.cassandraSSL(builder.cassandraSSL); } if (builder.cassandraKeyspace != null) { initShim.cassandraKeyspace(builder.cassandraKeyspace); } if (builder.cassandraReadConsistencyLevel != null) { initShim.cassandraReadConsistencyLevel(builder.cassandraReadConsistencyLevel); } if (builder.cassandraWriteConsistencyLevel != null) { initShim.cassandraWriteConsistencyLevel(builder.cassandraWriteConsistencyLevel); } if (builder.cassandraSymmetricEncryptionKey != null) { initShim.cassandraSymmetricEncryptionKey(builder.cassandraSymmetricEncryptionKey); } if (builder.cassandraMaxConcurrentQueriesIsSet()) { initShim.cassandraMaxConcurrentQueries(builder.cassandraMaxConcurrentQueries); } if (builder.cassandraPoolTimeoutMillisIsSet()) { initShim.cassandraPoolTimeoutMillis(builder.cassandraPoolTimeoutMillis); } if (builder.grpcBindAddress != null) { initShim.grpcBindAddress(builder.grpcBindAddress); } if (builder.grpcHttpPortIsSet()) { initShim.grpcHttpPort(builder.grpcHttpPort); } if (builder.grpcHttpsPortIsSet()) { initShim.grpcHttpsPort(builder.grpcHttpsPort); } if (builder.uiBindAddress != null) { initShim.uiBindAddress(builder.uiBindAddress); } if (builder.uiPortIsSet()) { initShim.uiPort(builder.uiPort); } if (builder.uiHttpsIsSet()) { initShim.uiHttps(builder.uiHttps); } if (builder.uiContextPath != null) { initShim.uiContextPath(builder.uiContextPath); } this.cassandraContactPoint = initShim.cassandraContactPoint(); this.cassandraPort = initShim.cassandraPort(); this.cassandraUsername = initShim.cassandraUsername(); this.cassandraPassword = initShim.cassandraPassword(); this.cassandraSSL = initShim.cassandraSSL(); this.cassandraKeyspace = initShim.cassandraKeyspace(); this.cassandraReadConsistencyLevel = initShim.cassandraReadConsistencyLevel(); this.cassandraWriteConsistencyLevel = initShim.cassandraWriteConsistencyLevel(); this.cassandraConsistencyLevelDisplay = initShim.cassandraConsistencyLevelDisplay(); this.cassandraSymmetricEncryptionKey = initShim.cassandraSymmetricEncryptionKey(); this.cassandraMaxConcurrentQueries = initShim.cassandraMaxConcurrentQueries(); this.cassandraPoolTimeoutMillis = initShim.cassandraPoolTimeoutMillis(); this.grpcBindAddress = initShim.grpcBindAddress(); this.grpcHttpPort = initShim.grpcHttpPort(); this.grpcHttpsPort = initShim.grpcHttpsPort(); this.uiBindAddress = initShim.uiBindAddress(); this.uiPort = initShim.uiPort(); this.uiHttps = initShim.uiHttps(); this.uiContextPath = initShim.uiContextPath(); this.initShim = null; } private ImmutableCentralConfiguration( ImmutableList cassandraContactPoint, int cassandraPort, String cassandraUsername, String cassandraPassword, boolean cassandraSSL, String cassandraKeyspace, ConsistencyLevel cassandraReadConsistencyLevel, ConsistencyLevel cassandraWriteConsistencyLevel, String cassandraSymmetricEncryptionKey, int cassandraMaxConcurrentQueries, int cassandraPoolTimeoutMillis, String grpcBindAddress, java.lang.@Nullable Integer grpcHttpPort, java.lang.@Nullable Integer grpcHttpsPort, String uiBindAddress, int uiPort, boolean uiHttps, String uiContextPath, ImmutableMap jgroupsProperties) { initShim.cassandraContactPoint(cassandraContactPoint); initShim.cassandraPort(cassandraPort); initShim.cassandraUsername(cassandraUsername); initShim.cassandraPassword(cassandraPassword); initShim.cassandraSSL(cassandraSSL); initShim.cassandraKeyspace(cassandraKeyspace); initShim.cassandraReadConsistencyLevel(cassandraReadConsistencyLevel); initShim.cassandraWriteConsistencyLevel(cassandraWriteConsistencyLevel); initShim.cassandraSymmetricEncryptionKey(cassandraSymmetricEncryptionKey); initShim.cassandraMaxConcurrentQueries(cassandraMaxConcurrentQueries); initShim.cassandraPoolTimeoutMillis(cassandraPoolTimeoutMillis); initShim.grpcBindAddress(grpcBindAddress); initShim.grpcHttpPort(grpcHttpPort); initShim.grpcHttpsPort(grpcHttpsPort); initShim.uiBindAddress(uiBindAddress); initShim.uiPort(uiPort); initShim.uiHttps(uiHttps); initShim.uiContextPath(uiContextPath); this.jgroupsProperties = jgroupsProperties; this.cassandraContactPoint = initShim.cassandraContactPoint(); this.cassandraPort = initShim.cassandraPort(); this.cassandraUsername = initShim.cassandraUsername(); this.cassandraPassword = initShim.cassandraPassword(); this.cassandraSSL = initShim.cassandraSSL(); this.cassandraKeyspace = initShim.cassandraKeyspace(); this.cassandraReadConsistencyLevel = initShim.cassandraReadConsistencyLevel(); this.cassandraWriteConsistencyLevel = initShim.cassandraWriteConsistencyLevel(); this.cassandraConsistencyLevelDisplay = initShim.cassandraConsistencyLevelDisplay(); this.cassandraSymmetricEncryptionKey = initShim.cassandraSymmetricEncryptionKey(); this.cassandraMaxConcurrentQueries = initShim.cassandraMaxConcurrentQueries(); this.cassandraPoolTimeoutMillis = initShim.cassandraPoolTimeoutMillis(); this.grpcBindAddress = initShim.grpcBindAddress(); this.grpcHttpPort = initShim.grpcHttpPort(); this.grpcHttpsPort = initShim.grpcHttpsPort(); this.uiBindAddress = initShim.uiBindAddress(); this.uiPort = initShim.uiPort(); this.uiHttps = initShim.uiHttps(); this.uiContextPath = initShim.uiContextPath(); this.initShim = null; } private static final byte STAGE_INITIALIZING = -1; private static final byte STAGE_UNINITIALIZED = 0; private static final byte STAGE_INITIALIZED = 1; @SuppressWarnings("Immutable") private transient volatile InitShim initShim = new InitShim(); @Generated(from = "CentralModule.CentralConfiguration", generator = "Immutables") private final class InitShim { private byte cassandraContactPointBuildStage = STAGE_UNINITIALIZED; private ImmutableList cassandraContactPoint; ImmutableList cassandraContactPoint() { if (cassandraContactPointBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraContactPointBuildStage == STAGE_UNINITIALIZED) { cassandraContactPointBuildStage = STAGE_INITIALIZING; this.cassandraContactPoint = ImmutableList.copyOf(ImmutableCentralConfiguration.super.cassandraContactPoint()); cassandraContactPointBuildStage = STAGE_INITIALIZED; } return this.cassandraContactPoint; } void cassandraContactPoint(ImmutableList cassandraContactPoint) { this.cassandraContactPoint = cassandraContactPoint; cassandraContactPointBuildStage = STAGE_INITIALIZED; } private byte cassandraPortBuildStage = STAGE_UNINITIALIZED; private int cassandraPort; int cassandraPort() { if (cassandraPortBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraPortBuildStage == STAGE_UNINITIALIZED) { cassandraPortBuildStage = STAGE_INITIALIZING; this.cassandraPort = ImmutableCentralConfiguration.super.cassandraPort(); cassandraPortBuildStage = STAGE_INITIALIZED; } return this.cassandraPort; } void cassandraPort(int cassandraPort) { this.cassandraPort = cassandraPort; cassandraPortBuildStage = STAGE_INITIALIZED; } private byte cassandraUsernameBuildStage = STAGE_UNINITIALIZED; private String cassandraUsername; String cassandraUsername() { if (cassandraUsernameBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraUsernameBuildStage == STAGE_UNINITIALIZED) { cassandraUsernameBuildStage = STAGE_INITIALIZING; this.cassandraUsername = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraUsername(), "cassandraUsername"); cassandraUsernameBuildStage = STAGE_INITIALIZED; } return this.cassandraUsername; } void cassandraUsername(String cassandraUsername) { this.cassandraUsername = cassandraUsername; cassandraUsernameBuildStage = STAGE_INITIALIZED; } private byte cassandraPasswordBuildStage = STAGE_UNINITIALIZED; private String cassandraPassword; String cassandraPassword() { if (cassandraPasswordBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraPasswordBuildStage == STAGE_UNINITIALIZED) { cassandraPasswordBuildStage = STAGE_INITIALIZING; this.cassandraPassword = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraPassword(), "cassandraPassword"); cassandraPasswordBuildStage = STAGE_INITIALIZED; } return this.cassandraPassword; } void cassandraPassword(String cassandraPassword) { this.cassandraPassword = cassandraPassword; cassandraPasswordBuildStage = STAGE_INITIALIZED; } private byte cassandraSSLBuildStage = STAGE_UNINITIALIZED; private boolean cassandraSSL; boolean cassandraSSL() { if (cassandraSSLBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraSSLBuildStage == STAGE_UNINITIALIZED) { cassandraSSLBuildStage = STAGE_INITIALIZING; this.cassandraSSL = ImmutableCentralConfiguration.super.cassandraSSL(); cassandraSSLBuildStage = STAGE_INITIALIZED; } return this.cassandraSSL; } void cassandraSSL(boolean cassandraSSL) { this.cassandraSSL = cassandraSSL; cassandraSSLBuildStage = STAGE_INITIALIZED; } private byte cassandraKeyspaceBuildStage = STAGE_UNINITIALIZED; private String cassandraKeyspace; String cassandraKeyspace() { if (cassandraKeyspaceBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraKeyspaceBuildStage == STAGE_UNINITIALIZED) { cassandraKeyspaceBuildStage = STAGE_INITIALIZING; this.cassandraKeyspace = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraKeyspace(), "cassandraKeyspace"); cassandraKeyspaceBuildStage = STAGE_INITIALIZED; } return this.cassandraKeyspace; } void cassandraKeyspace(String cassandraKeyspace) { this.cassandraKeyspace = cassandraKeyspace; cassandraKeyspaceBuildStage = STAGE_INITIALIZED; } private byte cassandraReadConsistencyLevelBuildStage = STAGE_UNINITIALIZED; private ConsistencyLevel cassandraReadConsistencyLevel; ConsistencyLevel cassandraReadConsistencyLevel() { if (cassandraReadConsistencyLevelBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraReadConsistencyLevelBuildStage == STAGE_UNINITIALIZED) { cassandraReadConsistencyLevelBuildStage = STAGE_INITIALIZING; this.cassandraReadConsistencyLevel = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraReadConsistencyLevel(), "cassandraReadConsistencyLevel"); cassandraReadConsistencyLevelBuildStage = STAGE_INITIALIZED; } return this.cassandraReadConsistencyLevel; } void cassandraReadConsistencyLevel(ConsistencyLevel cassandraReadConsistencyLevel) { this.cassandraReadConsistencyLevel = cassandraReadConsistencyLevel; cassandraReadConsistencyLevelBuildStage = STAGE_INITIALIZED; } private byte cassandraWriteConsistencyLevelBuildStage = STAGE_UNINITIALIZED; private ConsistencyLevel cassandraWriteConsistencyLevel; ConsistencyLevel cassandraWriteConsistencyLevel() { if (cassandraWriteConsistencyLevelBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraWriteConsistencyLevelBuildStage == STAGE_UNINITIALIZED) { cassandraWriteConsistencyLevelBuildStage = STAGE_INITIALIZING; this.cassandraWriteConsistencyLevel = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraWriteConsistencyLevel(), "cassandraWriteConsistencyLevel"); cassandraWriteConsistencyLevelBuildStage = STAGE_INITIALIZED; } return this.cassandraWriteConsistencyLevel; } void cassandraWriteConsistencyLevel(ConsistencyLevel cassandraWriteConsistencyLevel) { this.cassandraWriteConsistencyLevel = cassandraWriteConsistencyLevel; cassandraWriteConsistencyLevelBuildStage = STAGE_INITIALIZED; } private byte cassandraConsistencyLevelDisplayBuildStage = STAGE_UNINITIALIZED; private String cassandraConsistencyLevelDisplay; String cassandraConsistencyLevelDisplay() { if (cassandraConsistencyLevelDisplayBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraConsistencyLevelDisplayBuildStage == STAGE_UNINITIALIZED) { cassandraConsistencyLevelDisplayBuildStage = STAGE_INITIALIZING; this.cassandraConsistencyLevelDisplay = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraConsistencyLevelDisplay(), "cassandraConsistencyLevelDisplay"); cassandraConsistencyLevelDisplayBuildStage = STAGE_INITIALIZED; } return this.cassandraConsistencyLevelDisplay; } private byte cassandraSymmetricEncryptionKeyBuildStage = STAGE_UNINITIALIZED; private String cassandraSymmetricEncryptionKey; String cassandraSymmetricEncryptionKey() { if (cassandraSymmetricEncryptionKeyBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraSymmetricEncryptionKeyBuildStage == STAGE_UNINITIALIZED) { cassandraSymmetricEncryptionKeyBuildStage = STAGE_INITIALIZING; this.cassandraSymmetricEncryptionKey = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraSymmetricEncryptionKey(), "cassandraSymmetricEncryptionKey"); cassandraSymmetricEncryptionKeyBuildStage = STAGE_INITIALIZED; } return this.cassandraSymmetricEncryptionKey; } void cassandraSymmetricEncryptionKey(String cassandraSymmetricEncryptionKey) { this.cassandraSymmetricEncryptionKey = cassandraSymmetricEncryptionKey; cassandraSymmetricEncryptionKeyBuildStage = STAGE_INITIALIZED; } private byte cassandraMaxConcurrentQueriesBuildStage = STAGE_UNINITIALIZED; private int cassandraMaxConcurrentQueries; int cassandraMaxConcurrentQueries() { if (cassandraMaxConcurrentQueriesBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraMaxConcurrentQueriesBuildStage == STAGE_UNINITIALIZED) { cassandraMaxConcurrentQueriesBuildStage = STAGE_INITIALIZING; this.cassandraMaxConcurrentQueries = ImmutableCentralConfiguration.super.cassandraMaxConcurrentQueries(); cassandraMaxConcurrentQueriesBuildStage = STAGE_INITIALIZED; } return this.cassandraMaxConcurrentQueries; } void cassandraMaxConcurrentQueries(int cassandraMaxConcurrentQueries) { this.cassandraMaxConcurrentQueries = cassandraMaxConcurrentQueries; cassandraMaxConcurrentQueriesBuildStage = STAGE_INITIALIZED; } private byte cassandraPoolTimeoutMillisBuildStage = STAGE_UNINITIALIZED; private int cassandraPoolTimeoutMillis; int cassandraPoolTimeoutMillis() { if (cassandraPoolTimeoutMillisBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (cassandraPoolTimeoutMillisBuildStage == STAGE_UNINITIALIZED) { cassandraPoolTimeoutMillisBuildStage = STAGE_INITIALIZING; this.cassandraPoolTimeoutMillis = ImmutableCentralConfiguration.super.cassandraPoolTimeoutMillis(); cassandraPoolTimeoutMillisBuildStage = STAGE_INITIALIZED; } return this.cassandraPoolTimeoutMillis; } void cassandraPoolTimeoutMillis(int cassandraPoolTimeoutMillis) { this.cassandraPoolTimeoutMillis = cassandraPoolTimeoutMillis; cassandraPoolTimeoutMillisBuildStage = STAGE_INITIALIZED; } private byte grpcBindAddressBuildStage = STAGE_UNINITIALIZED; private String grpcBindAddress; String grpcBindAddress() { if (grpcBindAddressBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (grpcBindAddressBuildStage == STAGE_UNINITIALIZED) { grpcBindAddressBuildStage = STAGE_INITIALIZING; this.grpcBindAddress = Objects.requireNonNull(ImmutableCentralConfiguration.super.grpcBindAddress(), "grpcBindAddress"); grpcBindAddressBuildStage = STAGE_INITIALIZED; } return this.grpcBindAddress; } void grpcBindAddress(String grpcBindAddress) { this.grpcBindAddress = grpcBindAddress; grpcBindAddressBuildStage = STAGE_INITIALIZED; } private byte grpcHttpPortBuildStage = STAGE_UNINITIALIZED; private java.lang.@Nullable Integer grpcHttpPort; java.lang.@Nullable Integer grpcHttpPort() { if (grpcHttpPortBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (grpcHttpPortBuildStage == STAGE_UNINITIALIZED) { grpcHttpPortBuildStage = STAGE_INITIALIZING; this.grpcHttpPort = ImmutableCentralConfiguration.super.grpcHttpPort(); grpcHttpPortBuildStage = STAGE_INITIALIZED; } return this.grpcHttpPort; } void grpcHttpPort(java.lang.@Nullable Integer grpcHttpPort) { this.grpcHttpPort = grpcHttpPort; grpcHttpPortBuildStage = STAGE_INITIALIZED; } private byte grpcHttpsPortBuildStage = STAGE_UNINITIALIZED; private java.lang.@Nullable Integer grpcHttpsPort; java.lang.@Nullable Integer grpcHttpsPort() { if (grpcHttpsPortBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (grpcHttpsPortBuildStage == STAGE_UNINITIALIZED) { grpcHttpsPortBuildStage = STAGE_INITIALIZING; this.grpcHttpsPort = ImmutableCentralConfiguration.super.grpcHttpsPort(); grpcHttpsPortBuildStage = STAGE_INITIALIZED; } return this.grpcHttpsPort; } void grpcHttpsPort(java.lang.@Nullable Integer grpcHttpsPort) { this.grpcHttpsPort = grpcHttpsPort; grpcHttpsPortBuildStage = STAGE_INITIALIZED; } private byte uiBindAddressBuildStage = STAGE_UNINITIALIZED; private String uiBindAddress; String uiBindAddress() { if (uiBindAddressBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (uiBindAddressBuildStage == STAGE_UNINITIALIZED) { uiBindAddressBuildStage = STAGE_INITIALIZING; this.uiBindAddress = Objects.requireNonNull(ImmutableCentralConfiguration.super.uiBindAddress(), "uiBindAddress"); uiBindAddressBuildStage = STAGE_INITIALIZED; } return this.uiBindAddress; } void uiBindAddress(String uiBindAddress) { this.uiBindAddress = uiBindAddress; uiBindAddressBuildStage = STAGE_INITIALIZED; } private byte uiPortBuildStage = STAGE_UNINITIALIZED; private int uiPort; int uiPort() { if (uiPortBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (uiPortBuildStage == STAGE_UNINITIALIZED) { uiPortBuildStage = STAGE_INITIALIZING; this.uiPort = ImmutableCentralConfiguration.super.uiPort(); uiPortBuildStage = STAGE_INITIALIZED; } return this.uiPort; } void uiPort(int uiPort) { this.uiPort = uiPort; uiPortBuildStage = STAGE_INITIALIZED; } private byte uiHttpsBuildStage = STAGE_UNINITIALIZED; private boolean uiHttps; boolean uiHttps() { if (uiHttpsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (uiHttpsBuildStage == STAGE_UNINITIALIZED) { uiHttpsBuildStage = STAGE_INITIALIZING; this.uiHttps = ImmutableCentralConfiguration.super.uiHttps(); uiHttpsBuildStage = STAGE_INITIALIZED; } return this.uiHttps; } void uiHttps(boolean uiHttps) { this.uiHttps = uiHttps; uiHttpsBuildStage = STAGE_INITIALIZED; } private byte uiContextPathBuildStage = STAGE_UNINITIALIZED; private String uiContextPath; String uiContextPath() { if (uiContextPathBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (uiContextPathBuildStage == STAGE_UNINITIALIZED) { uiContextPathBuildStage = STAGE_INITIALIZING; this.uiContextPath = Objects.requireNonNull(ImmutableCentralConfiguration.super.uiContextPath(), "uiContextPath"); uiContextPathBuildStage = STAGE_INITIALIZED; } return this.uiContextPath; } void uiContextPath(String uiContextPath) { this.uiContextPath = uiContextPath; uiContextPathBuildStage = STAGE_INITIALIZED; } private String formatInitCycleMessage() { List attributes = new ArrayList<>(); if (cassandraContactPointBuildStage == STAGE_INITIALIZING) attributes.add("cassandraContactPoint"); if (cassandraPortBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPort"); if (cassandraUsernameBuildStage == STAGE_INITIALIZING) attributes.add("cassandraUsername"); if (cassandraPasswordBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPassword"); if (cassandraSSLBuildStage == STAGE_INITIALIZING) attributes.add("cassandraSSL"); if (cassandraKeyspaceBuildStage == STAGE_INITIALIZING) attributes.add("cassandraKeyspace"); if (cassandraReadConsistencyLevelBuildStage == STAGE_INITIALIZING) attributes.add("cassandraReadConsistencyLevel"); if (cassandraWriteConsistencyLevelBuildStage == STAGE_INITIALIZING) attributes.add("cassandraWriteConsistencyLevel"); if (cassandraConsistencyLevelDisplayBuildStage == STAGE_INITIALIZING) attributes.add("cassandraConsistencyLevelDisplay"); if (cassandraSymmetricEncryptionKeyBuildStage == STAGE_INITIALIZING) attributes.add("cassandraSymmetricEncryptionKey"); if (cassandraMaxConcurrentQueriesBuildStage == STAGE_INITIALIZING) attributes.add("cassandraMaxConcurrentQueries"); if (cassandraPoolTimeoutMillisBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPoolTimeoutMillis"); if (grpcBindAddressBuildStage == STAGE_INITIALIZING) attributes.add("grpcBindAddress"); if (grpcHttpPortBuildStage == STAGE_INITIALIZING) attributes.add("grpcHttpPort"); if (grpcHttpsPortBuildStage == STAGE_INITIALIZING) attributes.add("grpcHttpsPort"); if (uiBindAddressBuildStage == STAGE_INITIALIZING) attributes.add("uiBindAddress"); if (uiPortBuildStage == STAGE_INITIALIZING) attributes.add("uiPort"); if (uiHttpsBuildStage == STAGE_INITIALIZING) attributes.add("uiHttps"); if (uiContextPathBuildStage == STAGE_INITIALIZING) attributes.add("uiContextPath"); return "Cannot build CentralConfiguration, attribute initializers form cycle " + attributes; } } /** * @return The value of the {@code cassandraContactPoint} attribute */ @JsonProperty("cassandraContactPoint") @Override ImmutableList cassandraContactPoint() { InitShim shim = this.initShim; return shim != null ? shim.cassandraContactPoint() : this.cassandraContactPoint; } /** * @return The value of the {@code cassandraPort} attribute */ @JsonProperty("cassandraPort") @Override int cassandraPort() { InitShim shim = this.initShim; return shim != null ? shim.cassandraPort() : this.cassandraPort; } /** * @return The value of the {@code cassandraUsername} attribute */ @JsonProperty("cassandraUsername") @Override String cassandraUsername() { InitShim shim = this.initShim; return shim != null ? shim.cassandraUsername() : this.cassandraUsername; } /** * @return The value of the {@code cassandraPassword} attribute */ @JsonProperty("cassandraPassword") @Override String cassandraPassword() { InitShim shim = this.initShim; return shim != null ? shim.cassandraPassword() : this.cassandraPassword; } /** * @return The value of the {@code cassandraSSL} attribute */ @JsonProperty("cassandraSSL") @Override boolean cassandraSSL() { InitShim shim = this.initShim; return shim != null ? shim.cassandraSSL() : this.cassandraSSL; } /** * @return The value of the {@code cassandraKeyspace} attribute */ @JsonProperty("cassandraKeyspace") @Override String cassandraKeyspace() { InitShim shim = this.initShim; return shim != null ? shim.cassandraKeyspace() : this.cassandraKeyspace; } /** * @return The value of the {@code cassandraReadConsistencyLevel} attribute */ @JsonProperty("cassandraReadConsistencyLevel") @Override ConsistencyLevel cassandraReadConsistencyLevel() { InitShim shim = this.initShim; return shim != null ? shim.cassandraReadConsistencyLevel() : this.cassandraReadConsistencyLevel; } /** * @return The value of the {@code cassandraWriteConsistencyLevel} attribute */ @JsonProperty("cassandraWriteConsistencyLevel") @Override ConsistencyLevel cassandraWriteConsistencyLevel() { InitShim shim = this.initShim; return shim != null ? shim.cassandraWriteConsistencyLevel() : this.cassandraWriteConsistencyLevel; } /** * @return The computed-at-construction value of the {@code cassandraConsistencyLevelDisplay} attribute */ @JsonProperty("cassandraConsistencyLevelDisplay") @Override String cassandraConsistencyLevelDisplay() { InitShim shim = this.initShim; return shim != null ? shim.cassandraConsistencyLevelDisplay() : this.cassandraConsistencyLevelDisplay; } /** * @return The value of the {@code cassandraSymmetricEncryptionKey} attribute */ @JsonProperty("cassandraSymmetricEncryptionKey") @Override String cassandraSymmetricEncryptionKey() { InitShim shim = this.initShim; return shim != null ? shim.cassandraSymmetricEncryptionKey() : this.cassandraSymmetricEncryptionKey; } /** * @return The value of the {@code cassandraMaxConcurrentQueries} attribute */ @JsonProperty("cassandraMaxConcurrentQueries") @Override int cassandraMaxConcurrentQueries() { InitShim shim = this.initShim; return shim != null ? shim.cassandraMaxConcurrentQueries() : this.cassandraMaxConcurrentQueries; } /** * @return The value of the {@code cassandraPoolTimeoutMillis} attribute */ @JsonProperty("cassandraPoolTimeoutMillis") @Override int cassandraPoolTimeoutMillis() { InitShim shim = this.initShim; return shim != null ? shim.cassandraPoolTimeoutMillis() : this.cassandraPoolTimeoutMillis; } /** * @return The value of the {@code grpcBindAddress} attribute */ @JsonProperty("grpcBindAddress") @Override String grpcBindAddress() { InitShim shim = this.initShim; return shim != null ? shim.grpcBindAddress() : this.grpcBindAddress; } /** * @return The value of the {@code grpcHttpPort} attribute */ @JsonProperty("grpcHttpPort") @Override java.lang.@Nullable Integer grpcHttpPort() { InitShim shim = this.initShim; return shim != null ? shim.grpcHttpPort() : this.grpcHttpPort; } /** * @return The value of the {@code grpcHttpsPort} attribute */ @JsonProperty("grpcHttpsPort") @Override java.lang.@Nullable Integer grpcHttpsPort() { InitShim shim = this.initShim; return shim != null ? shim.grpcHttpsPort() : this.grpcHttpsPort; } /** * @return The value of the {@code uiBindAddress} attribute */ @JsonProperty("uiBindAddress") @Override String uiBindAddress() { InitShim shim = this.initShim; return shim != null ? shim.uiBindAddress() : this.uiBindAddress; } /** * @return The value of the {@code uiPort} attribute */ @JsonProperty("uiPort") @Override int uiPort() { InitShim shim = this.initShim; return shim != null ? shim.uiPort() : this.uiPort; } /** * @return The value of the {@code uiHttps} attribute */ @JsonProperty("uiHttps") @Override boolean uiHttps() { InitShim shim = this.initShim; return shim != null ? shim.uiHttps() : this.uiHttps; } /** * @return The value of the {@code uiContextPath} attribute */ @JsonProperty("uiContextPath") @Override String uiContextPath() { InitShim shim = this.initShim; return shim != null ? shim.uiContextPath() : this.uiContextPath; } /** * @return The value of the {@code jgroupsProperties} attribute */ @JsonProperty("jgroupsProperties") @Override ImmutableMap jgroupsProperties() { return jgroupsProperties; } /** * Copy the current immutable object with elements that replace the content of {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableCentralConfiguration withCassandraContactPoint(String... elements) { ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableCentralConfiguration( newValue, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object with elements that replace the content of {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of cassandraContactPoint elements to set * @return A modified copy of {@code this} object */ public final ImmutableCentralConfiguration withCassandraContactPoint(Iterable elements) { if (this.cassandraContactPoint == elements) return this; ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableCentralConfiguration( newValue, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraPort() cassandraPort} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraPort * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraPort(int value) { if (this.cassandraPort == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, value, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraUsername() cassandraUsername} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraUsername * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraUsername(String value) { String newValue = Objects.requireNonNull(value, "cassandraUsername"); if (this.cassandraUsername.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, newValue, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraPassword() cassandraPassword} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraPassword * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraPassword(String value) { String newValue = Objects.requireNonNull(value, "cassandraPassword"); if (this.cassandraPassword.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, newValue, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraSSL() cassandraSSL} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraSSL * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraSSL(boolean value) { if (this.cassandraSSL == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, value, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraKeyspace() cassandraKeyspace} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraKeyspace * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraKeyspace(String value) { String newValue = Objects.requireNonNull(value, "cassandraKeyspace"); if (this.cassandraKeyspace.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, newValue, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraReadConsistencyLevel() cassandraReadConsistencyLevel} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraReadConsistencyLevel * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraReadConsistencyLevel(ConsistencyLevel value) { if (this.cassandraReadConsistencyLevel == value) return this; ConsistencyLevel newValue = Objects.requireNonNull(value, "cassandraReadConsistencyLevel"); if (this.cassandraReadConsistencyLevel.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, newValue, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraWriteConsistencyLevel() cassandraWriteConsistencyLevel} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraWriteConsistencyLevel * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraWriteConsistencyLevel(ConsistencyLevel value) { if (this.cassandraWriteConsistencyLevel == value) return this; ConsistencyLevel newValue = Objects.requireNonNull(value, "cassandraWriteConsistencyLevel"); if (this.cassandraWriteConsistencyLevel.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, newValue, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraSymmetricEncryptionKey() cassandraSymmetricEncryptionKey} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraSymmetricEncryptionKey * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraSymmetricEncryptionKey(String value) { String newValue = Objects.requireNonNull(value, "cassandraSymmetricEncryptionKey"); if (this.cassandraSymmetricEncryptionKey.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, newValue, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraMaxConcurrentQueries() cassandraMaxConcurrentQueries} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraMaxConcurrentQueries * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraMaxConcurrentQueries(int value) { if (this.cassandraMaxConcurrentQueries == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, value, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#cassandraPoolTimeoutMillis() cassandraPoolTimeoutMillis} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for cassandraPoolTimeoutMillis * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withCassandraPoolTimeoutMillis(int value) { if (this.cassandraPoolTimeoutMillis == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, value, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#grpcBindAddress() grpcBindAddress} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for grpcBindAddress * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withGrpcBindAddress(String value) { String newValue = Objects.requireNonNull(value, "grpcBindAddress"); if (this.grpcBindAddress.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, newValue, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#grpcHttpPort() grpcHttpPort} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for grpcHttpPort (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withGrpcHttpPort(java.lang.@Nullable Integer value) { if (Objects.equals(this.grpcHttpPort, value)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, value, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#grpcHttpsPort() grpcHttpsPort} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for grpcHttpsPort (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withGrpcHttpsPort(java.lang.@Nullable Integer value) { if (Objects.equals(this.grpcHttpsPort, value)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, value, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#uiBindAddress() uiBindAddress} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for uiBindAddress * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withUiBindAddress(String value) { String newValue = Objects.requireNonNull(value, "uiBindAddress"); if (this.uiBindAddress.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, newValue, this.uiPort, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#uiPort() uiPort} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for uiPort * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withUiPort(int value) { if (this.uiPort == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, value, this.uiHttps, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#uiHttps() uiHttps} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for uiHttps * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withUiHttps(boolean value) { if (this.uiHttps == value) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, value, this.uiContextPath, this.jgroupsProperties); } /** * Copy the current immutable object by setting a value for the {@link CentralModule.CentralConfiguration#uiContextPath() uiContextPath} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for uiContextPath * @return A modified copy of the {@code this} object */ public final ImmutableCentralConfiguration withUiContextPath(String value) { String newValue = Objects.requireNonNull(value, "uiContextPath"); if (this.uiContextPath.equals(newValue)) return this; return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, newValue, this.jgroupsProperties); } /** * Copy the current immutable object by replacing the {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the jgroupsProperties map * @return A modified copy of {@code this} object */ public final ImmutableCentralConfiguration withJgroupsProperties(Map entries) { if (this.jgroupsProperties == entries) return this; ImmutableMap newValue = ImmutableMap.copyOf(entries); return new ImmutableCentralConfiguration( this.cassandraContactPoint, this.cassandraPort, this.cassandraUsername, this.cassandraPassword, this.cassandraSSL, this.cassandraKeyspace, this.cassandraReadConsistencyLevel, this.cassandraWriteConsistencyLevel, this.cassandraSymmetricEncryptionKey, this.cassandraMaxConcurrentQueries, this.cassandraPoolTimeoutMillis, this.grpcBindAddress, this.grpcHttpPort, this.grpcHttpsPort, this.uiBindAddress, this.uiPort, this.uiHttps, this.uiContextPath, newValue); } /** * This instance is equal to all instances of {@code ImmutableCentralConfiguration} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@javax.annotation.Nullable Object another) { if (this == another) return true; return another instanceof ImmutableCentralConfiguration && equalTo((ImmutableCentralConfiguration) another); } private boolean equalTo(ImmutableCentralConfiguration another) { return cassandraContactPoint.equals(another.cassandraContactPoint) && cassandraPort == another.cassandraPort && cassandraUsername.equals(another.cassandraUsername) && cassandraPassword.equals(another.cassandraPassword) && cassandraSSL == another.cassandraSSL && cassandraKeyspace.equals(another.cassandraKeyspace) && cassandraReadConsistencyLevel.equals(another.cassandraReadConsistencyLevel) && cassandraWriteConsistencyLevel.equals(another.cassandraWriteConsistencyLevel) && cassandraConsistencyLevelDisplay.equals(another.cassandraConsistencyLevelDisplay) && cassandraSymmetricEncryptionKey.equals(another.cassandraSymmetricEncryptionKey) && cassandraMaxConcurrentQueries == another.cassandraMaxConcurrentQueries && cassandraPoolTimeoutMillis == another.cassandraPoolTimeoutMillis && grpcBindAddress.equals(another.grpcBindAddress) && Objects.equals(grpcHttpPort, another.grpcHttpPort) && Objects.equals(grpcHttpsPort, another.grpcHttpsPort) && uiBindAddress.equals(another.uiBindAddress) && uiPort == another.uiPort && uiHttps == another.uiHttps && uiContextPath.equals(another.uiContextPath) && jgroupsProperties.equals(another.jgroupsProperties); } /** * Computes a hash code from attributes: {@code cassandraContactPoint}, {@code cassandraPort}, {@code cassandraUsername}, {@code cassandraPassword}, {@code cassandraSSL}, {@code cassandraKeyspace}, {@code cassandraReadConsistencyLevel}, {@code cassandraWriteConsistencyLevel}, {@code cassandraConsistencyLevelDisplay}, {@code cassandraSymmetricEncryptionKey}, {@code cassandraMaxConcurrentQueries}, {@code cassandraPoolTimeoutMillis}, {@code grpcBindAddress}, {@code grpcHttpPort}, {@code grpcHttpsPort}, {@code uiBindAddress}, {@code uiPort}, {@code uiHttps}, {@code uiContextPath}, {@code jgroupsProperties}. * @return hashCode value */ @Override public int hashCode() { @Var int h = 5381; h += (h << 5) + cassandraContactPoint.hashCode(); h += (h << 5) + cassandraPort; h += (h << 5) + cassandraUsername.hashCode(); h += (h << 5) + cassandraPassword.hashCode(); h += (h << 5) + Booleans.hashCode(cassandraSSL); h += (h << 5) + cassandraKeyspace.hashCode(); h += (h << 5) + cassandraReadConsistencyLevel.hashCode(); h += (h << 5) + cassandraWriteConsistencyLevel.hashCode(); h += (h << 5) + cassandraConsistencyLevelDisplay.hashCode(); h += (h << 5) + cassandraSymmetricEncryptionKey.hashCode(); h += (h << 5) + cassandraMaxConcurrentQueries; h += (h << 5) + cassandraPoolTimeoutMillis; h += (h << 5) + grpcBindAddress.hashCode(); h += (h << 5) + Objects.hashCode(grpcHttpPort); h += (h << 5) + Objects.hashCode(grpcHttpsPort); h += (h << 5) + uiBindAddress.hashCode(); h += (h << 5) + uiPort; h += (h << 5) + Booleans.hashCode(uiHttps); h += (h << 5) + uiContextPath.hashCode(); h += (h << 5) + jgroupsProperties.hashCode(); return h; } /** * Prints the immutable value {@code CentralConfiguration} with attribute values. * @return A string representation of the value */ @Override public String toString() { return MoreObjects.toStringHelper("CentralConfiguration") .omitNullValues() .add("cassandraContactPoint", cassandraContactPoint) .add("cassandraPort", cassandraPort) .add("cassandraUsername", cassandraUsername) .add("cassandraPassword", cassandraPassword) .add("cassandraSSL", cassandraSSL) .add("cassandraKeyspace", cassandraKeyspace) .add("cassandraReadConsistencyLevel", cassandraReadConsistencyLevel) .add("cassandraWriteConsistencyLevel", cassandraWriteConsistencyLevel) .add("cassandraConsistencyLevelDisplay", cassandraConsistencyLevelDisplay) .add("cassandraSymmetricEncryptionKey", cassandraSymmetricEncryptionKey) .add("cassandraMaxConcurrentQueries", cassandraMaxConcurrentQueries) .add("cassandraPoolTimeoutMillis", cassandraPoolTimeoutMillis) .add("grpcBindAddress", grpcBindAddress) .add("grpcHttpPort", grpcHttpPort) .add("grpcHttpsPort", grpcHttpsPort) .add("uiBindAddress", uiBindAddress) .add("uiPort", uiPort) .add("uiHttps", uiHttps) .add("uiContextPath", uiContextPath) .add("jgroupsProperties", jgroupsProperties) .toString(); } /** * Utility type used to correctly read immutable object from JSON representation. * @deprecated Do not use this type directly, it exists only for the Jackson-binding infrastructure */ @Generated(from = "CentralModule.CentralConfiguration", generator = "Immutables") @Deprecated @SuppressWarnings("Immutable") @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE) static final class Json extends CentralModule.CentralConfiguration { @javax.annotation.Nullable List cassandraContactPoint = ImmutableList.of(); boolean cassandraContactPointIsSet; int cassandraPort; boolean cassandraPortIsSet; @javax.annotation.Nullable String cassandraUsername; @javax.annotation.Nullable String cassandraPassword; boolean cassandraSSL; boolean cassandraSSLIsSet; @javax.annotation.Nullable String cassandraKeyspace; @javax.annotation.Nullable ConsistencyLevel cassandraReadConsistencyLevel; @javax.annotation.Nullable ConsistencyLevel cassandraWriteConsistencyLevel; @javax.annotation.Nullable String cassandraSymmetricEncryptionKey; int cassandraMaxConcurrentQueries; boolean cassandraMaxConcurrentQueriesIsSet; int cassandraPoolTimeoutMillis; boolean cassandraPoolTimeoutMillisIsSet; @javax.annotation.Nullable String grpcBindAddress; @javax.annotation.Nullable java.lang.@Nullable Integer grpcHttpPort; boolean grpcHttpPortIsSet; @javax.annotation.Nullable java.lang.@Nullable Integer grpcHttpsPort; boolean grpcHttpsPortIsSet; @javax.annotation.Nullable String uiBindAddress; int uiPort; boolean uiPortIsSet; boolean uiHttps; boolean uiHttpsIsSet; @javax.annotation.Nullable String uiContextPath; @javax.annotation.Nullable Map jgroupsProperties = ImmutableMap.of(); @JsonProperty("cassandraContactPoint") public void setCassandraContactPoint(List cassandraContactPoint) { this.cassandraContactPoint = cassandraContactPoint; this.cassandraContactPointIsSet = true; } @JsonProperty("cassandraPort") public void setCassandraPort(int cassandraPort) { this.cassandraPort = cassandraPort; this.cassandraPortIsSet = true; } @JsonProperty("cassandraUsername") public void setCassandraUsername(String cassandraUsername) { this.cassandraUsername = cassandraUsername; } @JsonProperty("cassandraPassword") public void setCassandraPassword(String cassandraPassword) { this.cassandraPassword = cassandraPassword; } @JsonProperty("cassandraSSL") public void setCassandraSSL(boolean cassandraSSL) { this.cassandraSSL = cassandraSSL; this.cassandraSSLIsSet = true; } @JsonProperty("cassandraKeyspace") public void setCassandraKeyspace(String cassandraKeyspace) { this.cassandraKeyspace = cassandraKeyspace; } @JsonProperty("cassandraReadConsistencyLevel") public void setCassandraReadConsistencyLevel(ConsistencyLevel cassandraReadConsistencyLevel) { this.cassandraReadConsistencyLevel = cassandraReadConsistencyLevel; } @JsonProperty("cassandraWriteConsistencyLevel") public void setCassandraWriteConsistencyLevel(ConsistencyLevel cassandraWriteConsistencyLevel) { this.cassandraWriteConsistencyLevel = cassandraWriteConsistencyLevel; } @JsonProperty("cassandraSymmetricEncryptionKey") public void setCassandraSymmetricEncryptionKey(String cassandraSymmetricEncryptionKey) { this.cassandraSymmetricEncryptionKey = cassandraSymmetricEncryptionKey; } @JsonProperty("cassandraMaxConcurrentQueries") public void setCassandraMaxConcurrentQueries(int cassandraMaxConcurrentQueries) { this.cassandraMaxConcurrentQueries = cassandraMaxConcurrentQueries; this.cassandraMaxConcurrentQueriesIsSet = true; } @JsonProperty("cassandraPoolTimeoutMillis") public void setCassandraPoolTimeoutMillis(int cassandraPoolTimeoutMillis) { this.cassandraPoolTimeoutMillis = cassandraPoolTimeoutMillis; this.cassandraPoolTimeoutMillisIsSet = true; } @JsonProperty("grpcBindAddress") public void setGrpcBindAddress(String grpcBindAddress) { this.grpcBindAddress = grpcBindAddress; } @JsonProperty("grpcHttpPort") public void setGrpcHttpPort(java.lang.@Nullable Integer grpcHttpPort) { this.grpcHttpPort = grpcHttpPort; this.grpcHttpPortIsSet = true; } @JsonProperty("grpcHttpsPort") public void setGrpcHttpsPort(java.lang.@Nullable Integer grpcHttpsPort) { this.grpcHttpsPort = grpcHttpsPort; this.grpcHttpsPortIsSet = true; } @JsonProperty("uiBindAddress") public void setUiBindAddress(String uiBindAddress) { this.uiBindAddress = uiBindAddress; } @JsonProperty("uiPort") public void setUiPort(int uiPort) { this.uiPort = uiPort; this.uiPortIsSet = true; } @JsonProperty("uiHttps") public void setUiHttps(boolean uiHttps) { this.uiHttps = uiHttps; this.uiHttpsIsSet = true; } @JsonProperty("uiContextPath") public void setUiContextPath(String uiContextPath) { this.uiContextPath = uiContextPath; } @JsonProperty("jgroupsProperties") public void setJgroupsProperties(Map jgroupsProperties) { this.jgroupsProperties = jgroupsProperties; } @Override List cassandraContactPoint() { throw new UnsupportedOperationException(); } @Override int cassandraPort() { throw new UnsupportedOperationException(); } @Override String cassandraUsername() { throw new UnsupportedOperationException(); } @Override String cassandraPassword() { throw new UnsupportedOperationException(); } @Override boolean cassandraSSL() { throw new UnsupportedOperationException(); } @Override String cassandraKeyspace() { throw new UnsupportedOperationException(); } @Override ConsistencyLevel cassandraReadConsistencyLevel() { throw new UnsupportedOperationException(); } @Override ConsistencyLevel cassandraWriteConsistencyLevel() { throw new UnsupportedOperationException(); } @JsonIgnore @Override String cassandraConsistencyLevelDisplay() { throw new UnsupportedOperationException(); } @Override String cassandraSymmetricEncryptionKey() { throw new UnsupportedOperationException(); } @Override int cassandraMaxConcurrentQueries() { throw new UnsupportedOperationException(); } @Override int cassandraPoolTimeoutMillis() { throw new UnsupportedOperationException(); } @Override String grpcBindAddress() { throw new UnsupportedOperationException(); } @Override java.lang.@Nullable Integer grpcHttpPort() { throw new UnsupportedOperationException(); } @Override java.lang.@Nullable Integer grpcHttpsPort() { throw new UnsupportedOperationException(); } @Override String uiBindAddress() { throw new UnsupportedOperationException(); } @Override int uiPort() { throw new UnsupportedOperationException(); } @Override boolean uiHttps() { throw new UnsupportedOperationException(); } @Override String uiContextPath() { throw new UnsupportedOperationException(); } @Override Map jgroupsProperties() { throw new UnsupportedOperationException(); } } /** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the Jackson-binding infrastructure */ @Deprecated @JsonCreator(mode = JsonCreator.Mode.DELEGATING) static ImmutableCentralConfiguration fromJson(Json json) { ImmutableCentralConfiguration.Builder builder = ImmutableCentralConfiguration.builder(); if (json.cassandraContactPointIsSet) { builder.addAllCassandraContactPoint(json.cassandraContactPoint); } if (json.cassandraPortIsSet) { builder.cassandraPort(json.cassandraPort); } if (json.cassandraUsername != null) { builder.cassandraUsername(json.cassandraUsername); } if (json.cassandraPassword != null) { builder.cassandraPassword(json.cassandraPassword); } if (json.cassandraSSLIsSet) { builder.cassandraSSL(json.cassandraSSL); } if (json.cassandraKeyspace != null) { builder.cassandraKeyspace(json.cassandraKeyspace); } if (json.cassandraReadConsistencyLevel != null) { builder.cassandraReadConsistencyLevel(json.cassandraReadConsistencyLevel); } if (json.cassandraWriteConsistencyLevel != null) { builder.cassandraWriteConsistencyLevel(json.cassandraWriteConsistencyLevel); } if (json.cassandraSymmetricEncryptionKey != null) { builder.cassandraSymmetricEncryptionKey(json.cassandraSymmetricEncryptionKey); } if (json.cassandraMaxConcurrentQueriesIsSet) { builder.cassandraMaxConcurrentQueries(json.cassandraMaxConcurrentQueries); } if (json.cassandraPoolTimeoutMillisIsSet) { builder.cassandraPoolTimeoutMillis(json.cassandraPoolTimeoutMillis); } if (json.grpcBindAddress != null) { builder.grpcBindAddress(json.grpcBindAddress); } if (json.grpcHttpPortIsSet) { builder.grpcHttpPort(json.grpcHttpPort); } if (json.grpcHttpsPortIsSet) { builder.grpcHttpsPort(json.grpcHttpsPort); } if (json.uiBindAddress != null) { builder.uiBindAddress(json.uiBindAddress); } if (json.uiPortIsSet) { builder.uiPort(json.uiPort); } if (json.uiHttpsIsSet) { builder.uiHttps(json.uiHttps); } if (json.uiContextPath != null) { builder.uiContextPath(json.uiContextPath); } if (json.jgroupsProperties != null) { builder.putAllJgroupsProperties(json.jgroupsProperties); } return builder.build(); } /** * Creates an immutable copy of a {@link CentralModule.CentralConfiguration} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable CentralConfiguration instance */ public static ImmutableCentralConfiguration copyOf(CentralModule.CentralConfiguration instance) { if (instance instanceof ImmutableCentralConfiguration) { return (ImmutableCentralConfiguration) instance; } return ImmutableCentralConfiguration.builder() .copyFrom(instance) .build(); } /** * Creates a builder for {@link ImmutableCentralConfiguration ImmutableCentralConfiguration}. *

   * ImmutableCentralConfiguration.builder()
   *    .addCassandraContactPoint|addAllCassandraContactPoint(String) // {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint} elements
   *    .cassandraPort(int) // optional {@link CentralModule.CentralConfiguration#cassandraPort() cassandraPort}
   *    .cassandraUsername(String) // optional {@link CentralModule.CentralConfiguration#cassandraUsername() cassandraUsername}
   *    .cassandraPassword(String) // optional {@link CentralModule.CentralConfiguration#cassandraPassword() cassandraPassword}
   *    .cassandraSSL(boolean) // optional {@link CentralModule.CentralConfiguration#cassandraSSL() cassandraSSL}
   *    .cassandraKeyspace(String) // optional {@link CentralModule.CentralConfiguration#cassandraKeyspace() cassandraKeyspace}
   *    .cassandraReadConsistencyLevel(com.datastax.driver.core.ConsistencyLevel) // optional {@link CentralModule.CentralConfiguration#cassandraReadConsistencyLevel() cassandraReadConsistencyLevel}
   *    .cassandraWriteConsistencyLevel(com.datastax.driver.core.ConsistencyLevel) // optional {@link CentralModule.CentralConfiguration#cassandraWriteConsistencyLevel() cassandraWriteConsistencyLevel}
   *    .cassandraSymmetricEncryptionKey(String) // optional {@link CentralModule.CentralConfiguration#cassandraSymmetricEncryptionKey() cassandraSymmetricEncryptionKey}
   *    .cassandraMaxConcurrentQueries(int) // optional {@link CentralModule.CentralConfiguration#cassandraMaxConcurrentQueries() cassandraMaxConcurrentQueries}
   *    .cassandraPoolTimeoutMillis(int) // optional {@link CentralModule.CentralConfiguration#cassandraPoolTimeoutMillis() cassandraPoolTimeoutMillis}
   *    .grpcBindAddress(String) // optional {@link CentralModule.CentralConfiguration#grpcBindAddress() grpcBindAddress}
   *    .grpcHttpPort(@org.checkerframework.checker.nullness.qual.Nullable Integer | null) // nullable {@link CentralModule.CentralConfiguration#grpcHttpPort() grpcHttpPort}
   *    .grpcHttpsPort(@org.checkerframework.checker.nullness.qual.Nullable Integer | null) // nullable {@link CentralModule.CentralConfiguration#grpcHttpsPort() grpcHttpsPort}
   *    .uiBindAddress(String) // optional {@link CentralModule.CentralConfiguration#uiBindAddress() uiBindAddress}
   *    .uiPort(int) // optional {@link CentralModule.CentralConfiguration#uiPort() uiPort}
   *    .uiHttps(boolean) // optional {@link CentralModule.CentralConfiguration#uiHttps() uiHttps}
   *    .uiContextPath(String) // optional {@link CentralModule.CentralConfiguration#uiContextPath() uiContextPath}
   *    .putJgroupsProperties|putAllJgroupsProperties(String => String) // {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} mappings
   *    .build();
   * 
* @return A new ImmutableCentralConfiguration builder */ public static ImmutableCentralConfiguration.Builder builder() { return new ImmutableCentralConfiguration.Builder(); } /** * Builds instances of type {@link ImmutableCentralConfiguration ImmutableCentralConfiguration}. * Initialize attributes and then invoke the {@link #build()} method to create an * immutable instance. *

{@code Builder} is not thread-safe and generally should not be stored in a field or collection, * but instead used immediately to create instances. */ @Generated(from = "CentralModule.CentralConfiguration", generator = "Immutables") @NotThreadSafe public static final class Builder { private static final long OPT_BIT_CASSANDRA_CONTACT_POINT = 0x1L; private static final long OPT_BIT_CASSANDRA_PORT = 0x2L; private static final long OPT_BIT_CASSANDRA_S_S_L = 0x4L; private static final long OPT_BIT_CASSANDRA_MAX_CONCURRENT_QUERIES = 0x8L; private static final long OPT_BIT_CASSANDRA_POOL_TIMEOUT_MILLIS = 0x10L; private static final long OPT_BIT_GRPC_HTTP_PORT = 0x20L; private static final long OPT_BIT_GRPC_HTTPS_PORT = 0x40L; private static final long OPT_BIT_UI_PORT = 0x80L; private static final long OPT_BIT_UI_HTTPS = 0x100L; private long optBits; private ImmutableList.Builder cassandraContactPoint = ImmutableList.builder(); private int cassandraPort; private @javax.annotation.Nullable String cassandraUsername; private @javax.annotation.Nullable String cassandraPassword; private boolean cassandraSSL; private @javax.annotation.Nullable String cassandraKeyspace; private @javax.annotation.Nullable ConsistencyLevel cassandraReadConsistencyLevel; private @javax.annotation.Nullable ConsistencyLevel cassandraWriteConsistencyLevel; private @javax.annotation.Nullable String cassandraSymmetricEncryptionKey; private int cassandraMaxConcurrentQueries; private int cassandraPoolTimeoutMillis; private @javax.annotation.Nullable String grpcBindAddress; private @javax.annotation.Nullable java.lang.@Nullable Integer grpcHttpPort; private @javax.annotation.Nullable java.lang.@Nullable Integer grpcHttpsPort; private @javax.annotation.Nullable String uiBindAddress; private int uiPort; private boolean uiHttps; private @javax.annotation.Nullable String uiContextPath; private ImmutableMap.Builder jgroupsProperties = ImmutableMap.builder(); private Builder() { } /** * Fill a builder with attribute values from the provided {@code CentralConfiguration} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * Collection elements and entries will be added, not replaced. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder copyFrom(CentralModule.CentralConfiguration instance) { Objects.requireNonNull(instance, "instance"); addAllCassandraContactPoint(instance.cassandraContactPoint()); cassandraPort(instance.cassandraPort()); cassandraUsername(instance.cassandraUsername()); cassandraPassword(instance.cassandraPassword()); cassandraSSL(instance.cassandraSSL()); cassandraKeyspace(instance.cassandraKeyspace()); cassandraReadConsistencyLevel(instance.cassandraReadConsistencyLevel()); cassandraWriteConsistencyLevel(instance.cassandraWriteConsistencyLevel()); cassandraSymmetricEncryptionKey(instance.cassandraSymmetricEncryptionKey()); cassandraMaxConcurrentQueries(instance.cassandraMaxConcurrentQueries()); cassandraPoolTimeoutMillis(instance.cassandraPoolTimeoutMillis()); grpcBindAddress(instance.grpcBindAddress()); java.lang.@Nullable Integer grpcHttpPortValue = instance.grpcHttpPort(); if (grpcHttpPortValue != null) { grpcHttpPort(grpcHttpPortValue); } java.lang.@Nullable Integer grpcHttpsPortValue = instance.grpcHttpsPort(); if (grpcHttpsPortValue != null) { grpcHttpsPort(grpcHttpsPortValue); } uiBindAddress(instance.uiBindAddress()); uiPort(instance.uiPort()); uiHttps(instance.uiHttps()); uiContextPath(instance.uiContextPath()); putAllJgroupsProperties(instance.jgroupsProperties()); return this; } /** * Adds one element to {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint} list. * @param element A cassandraContactPoint element * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder addCassandraContactPoint(String element) { this.cassandraContactPoint.add(element); optBits |= OPT_BIT_CASSANDRA_CONTACT_POINT; return this; } /** * Adds elements to {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint} list. * @param elements An array of cassandraContactPoint elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder addCassandraContactPoint(String... elements) { this.cassandraContactPoint.add(elements); optBits |= OPT_BIT_CASSANDRA_CONTACT_POINT; return this; } /** * Sets or replaces all elements for {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint} list. * @param elements An iterable of cassandraContactPoint elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraContactPoint(Iterable elements) { this.cassandraContactPoint = ImmutableList.builder(); return addAllCassandraContactPoint(elements); } /** * Adds elements to {@link CentralModule.CentralConfiguration#cassandraContactPoint() cassandraContactPoint} list. * @param elements An iterable of cassandraContactPoint elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder addAllCassandraContactPoint(Iterable elements) { this.cassandraContactPoint.addAll(elements); optBits |= OPT_BIT_CASSANDRA_CONTACT_POINT; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraPort() cassandraPort} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraPort() cassandraPort}. * @param cassandraPort The value for cassandraPort * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraPort(int cassandraPort) { this.cassandraPort = cassandraPort; optBits |= OPT_BIT_CASSANDRA_PORT; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraUsername() cassandraUsername} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraUsername() cassandraUsername}. * @param cassandraUsername The value for cassandraUsername * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraUsername(String cassandraUsername) { this.cassandraUsername = Objects.requireNonNull(cassandraUsername, "cassandraUsername"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraPassword() cassandraPassword} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraPassword() cassandraPassword}. * @param cassandraPassword The value for cassandraPassword * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraPassword(String cassandraPassword) { this.cassandraPassword = Objects.requireNonNull(cassandraPassword, "cassandraPassword"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraSSL() cassandraSSL} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraSSL() cassandraSSL}. * @param cassandraSSL The value for cassandraSSL * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraSSL(boolean cassandraSSL) { this.cassandraSSL = cassandraSSL; optBits |= OPT_BIT_CASSANDRA_S_S_L; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraKeyspace() cassandraKeyspace} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraKeyspace() cassandraKeyspace}. * @param cassandraKeyspace The value for cassandraKeyspace * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraKeyspace(String cassandraKeyspace) { this.cassandraKeyspace = Objects.requireNonNull(cassandraKeyspace, "cassandraKeyspace"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraReadConsistencyLevel() cassandraReadConsistencyLevel} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraReadConsistencyLevel() cassandraReadConsistencyLevel}. * @param cassandraReadConsistencyLevel The value for cassandraReadConsistencyLevel * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraReadConsistencyLevel(ConsistencyLevel cassandraReadConsistencyLevel) { this.cassandraReadConsistencyLevel = Objects.requireNonNull(cassandraReadConsistencyLevel, "cassandraReadConsistencyLevel"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraWriteConsistencyLevel() cassandraWriteConsistencyLevel} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraWriteConsistencyLevel() cassandraWriteConsistencyLevel}. * @param cassandraWriteConsistencyLevel The value for cassandraWriteConsistencyLevel * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraWriteConsistencyLevel(ConsistencyLevel cassandraWriteConsistencyLevel) { this.cassandraWriteConsistencyLevel = Objects.requireNonNull(cassandraWriteConsistencyLevel, "cassandraWriteConsistencyLevel"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraSymmetricEncryptionKey() cassandraSymmetricEncryptionKey} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraSymmetricEncryptionKey() cassandraSymmetricEncryptionKey}. * @param cassandraSymmetricEncryptionKey The value for cassandraSymmetricEncryptionKey * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraSymmetricEncryptionKey(String cassandraSymmetricEncryptionKey) { this.cassandraSymmetricEncryptionKey = Objects.requireNonNull(cassandraSymmetricEncryptionKey, "cassandraSymmetricEncryptionKey"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraMaxConcurrentQueries() cassandraMaxConcurrentQueries} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraMaxConcurrentQueries() cassandraMaxConcurrentQueries}. * @param cassandraMaxConcurrentQueries The value for cassandraMaxConcurrentQueries * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraMaxConcurrentQueries(int cassandraMaxConcurrentQueries) { this.cassandraMaxConcurrentQueries = cassandraMaxConcurrentQueries; optBits |= OPT_BIT_CASSANDRA_MAX_CONCURRENT_QUERIES; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraPoolTimeoutMillis() cassandraPoolTimeoutMillis} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraPoolTimeoutMillis() cassandraPoolTimeoutMillis}. * @param cassandraPoolTimeoutMillis The value for cassandraPoolTimeoutMillis * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder cassandraPoolTimeoutMillis(int cassandraPoolTimeoutMillis) { this.cassandraPoolTimeoutMillis = cassandraPoolTimeoutMillis; optBits |= OPT_BIT_CASSANDRA_POOL_TIMEOUT_MILLIS; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#grpcBindAddress() grpcBindAddress} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#grpcBindAddress() grpcBindAddress}. * @param grpcBindAddress The value for grpcBindAddress * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder grpcBindAddress(String grpcBindAddress) { this.grpcBindAddress = Objects.requireNonNull(grpcBindAddress, "grpcBindAddress"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#grpcHttpPort() grpcHttpPort} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#grpcHttpPort() grpcHttpPort}. * @param grpcHttpPort The value for grpcHttpPort (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder grpcHttpPort(java.lang.@Nullable Integer grpcHttpPort) { this.grpcHttpPort = grpcHttpPort; optBits |= OPT_BIT_GRPC_HTTP_PORT; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#grpcHttpsPort() grpcHttpsPort} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#grpcHttpsPort() grpcHttpsPort}. * @param grpcHttpsPort The value for grpcHttpsPort (can be {@code null}) * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder grpcHttpsPort(java.lang.@Nullable Integer grpcHttpsPort) { this.grpcHttpsPort = grpcHttpsPort; optBits |= OPT_BIT_GRPC_HTTPS_PORT; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#uiBindAddress() uiBindAddress} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#uiBindAddress() uiBindAddress}. * @param uiBindAddress The value for uiBindAddress * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder uiBindAddress(String uiBindAddress) { this.uiBindAddress = Objects.requireNonNull(uiBindAddress, "uiBindAddress"); return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#uiPort() uiPort} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#uiPort() uiPort}. * @param uiPort The value for uiPort * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder uiPort(int uiPort) { this.uiPort = uiPort; optBits |= OPT_BIT_UI_PORT; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#uiHttps() uiHttps} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#uiHttps() uiHttps}. * @param uiHttps The value for uiHttps * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder uiHttps(boolean uiHttps) { this.uiHttps = uiHttps; optBits |= OPT_BIT_UI_HTTPS; return this; } /** * Initializes the value for the {@link CentralModule.CentralConfiguration#uiContextPath() uiContextPath} attribute. *

If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#uiContextPath() uiContextPath}. * @param uiContextPath The value for uiContextPath * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder uiContextPath(String uiContextPath) { this.uiContextPath = Objects.requireNonNull(uiContextPath, "uiContextPath"); return this; } /** * Put one entry to the {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map. * @param key The key in the jgroupsProperties map * @param value The associated value in the jgroupsProperties map * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder putJgroupsProperties(String key, String value) { this.jgroupsProperties.put(key, value); return this; } /** * Put one entry to the {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map. Nulls are not permitted * @param entry The key and value entry * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder putJgroupsProperties(Map.Entry entry) { this.jgroupsProperties.put(entry); return this; } /** * Sets or replaces all mappings from the specified map as entries for the {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map. Nulls are not permitted * @param entries The entries that will be added to the jgroupsProperties map * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder jgroupsProperties(Map entries) { this.jgroupsProperties = ImmutableMap.builder(); return putAllJgroupsProperties(entries); } /** * Put all mappings from the specified map as entries to {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map. Nulls are not permitted * @param entries The entries that will be added to the jgroupsProperties map * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder putAllJgroupsProperties(Map entries) { this.jgroupsProperties.putAll(entries); return this; } /** * Builds a new {@link ImmutableCentralConfiguration ImmutableCentralConfiguration}. * @return An immutable instance of CentralConfiguration * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableCentralConfiguration build() { return new ImmutableCentralConfiguration(this); } private boolean cassandraContactPointIsSet() { return (optBits & OPT_BIT_CASSANDRA_CONTACT_POINT) != 0; } private boolean cassandraPortIsSet() { return (optBits & OPT_BIT_CASSANDRA_PORT) != 0; } private boolean cassandraSSLIsSet() { return (optBits & OPT_BIT_CASSANDRA_S_S_L) != 0; } private boolean cassandraMaxConcurrentQueriesIsSet() { return (optBits & OPT_BIT_CASSANDRA_MAX_CONCURRENT_QUERIES) != 0; } private boolean cassandraPoolTimeoutMillisIsSet() { return (optBits & OPT_BIT_CASSANDRA_POOL_TIMEOUT_MILLIS) != 0; } private boolean grpcHttpPortIsSet() { return (optBits & OPT_BIT_GRPC_HTTP_PORT) != 0; } private boolean grpcHttpsPortIsSet() { return (optBits & OPT_BIT_GRPC_HTTPS_PORT) != 0; } private boolean uiPortIsSet() { return (optBits & OPT_BIT_UI_PORT) != 0; } private boolean uiHttpsIsSet() { return (optBits & OPT_BIT_UI_HTTPS) != 0; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy