org.glowroot.central.ImmutableCentralConfiguration Maven / Gradle / Ivy
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.JsonProperty;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.primitives.Booleans;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.CheckReturnValue;
import javax.annotation.Generated;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Immutable implementation of {@link CentralModule.CentralConfiguration}.
*
* Use the builder to create immutable instances:
* {@code ImmutableCentralConfiguration.builder()}.
*/
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@Generated({"Immutables.generator", "CentralModule.CentralConfiguration"})
@Immutable
@CheckReturnValue
final class ImmutableCentralConfiguration
extends CentralModule.CentralConfiguration {
private final ImmutableList cassandraContactPoint;
private final String cassandraUsername;
private final String cassandraPassword;
private final String cassandraKeyspace;
private final ConsistencyLevel cassandraConsistencyLevel;
private final String cassandraSymmetricEncryptionKey;
private final int cassandraPoolMaxRequestsPerConnection;
private final int cassandraPoolMaxQueueSize;
private final int cassandraPoolTimeoutMillis;
private final String grpcBindAddress;
private final @Nullable Integer grpcHttpPort;
private final @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.cassandraUsername != null) {
initShim.cassandraUsername(builder.cassandraUsername);
}
if (builder.cassandraPassword != null) {
initShim.cassandraPassword(builder.cassandraPassword);
}
if (builder.cassandraKeyspace != null) {
initShim.cassandraKeyspace(builder.cassandraKeyspace);
}
if (builder.cassandraConsistencyLevel != null) {
initShim.cassandraConsistencyLevel(builder.cassandraConsistencyLevel);
}
if (builder.cassandraSymmetricEncryptionKey != null) {
initShim.cassandraSymmetricEncryptionKey(builder.cassandraSymmetricEncryptionKey);
}
if (builder.cassandraPoolMaxRequestsPerConnectionIsSet()) {
initShim.cassandraPoolMaxRequestsPerConnection(builder.cassandraPoolMaxRequestsPerConnection);
}
if (builder.cassandraPoolMaxQueueSizeIsSet()) {
initShim.cassandraPoolMaxQueueSize(builder.cassandraPoolMaxQueueSize);
}
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.cassandraUsername = initShim.cassandraUsername();
this.cassandraPassword = initShim.cassandraPassword();
this.cassandraKeyspace = initShim.cassandraKeyspace();
this.cassandraConsistencyLevel = initShim.cassandraConsistencyLevel();
this.cassandraSymmetricEncryptionKey = initShim.cassandraSymmetricEncryptionKey();
this.cassandraPoolMaxRequestsPerConnection = initShim.cassandraPoolMaxRequestsPerConnection();
this.cassandraPoolMaxQueueSize = initShim.cassandraPoolMaxQueueSize();
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,
String cassandraUsername,
String cassandraPassword,
String cassandraKeyspace,
ConsistencyLevel cassandraConsistencyLevel,
String cassandraSymmetricEncryptionKey,
int cassandraPoolMaxRequestsPerConnection,
int cassandraPoolMaxQueueSize,
int cassandraPoolTimeoutMillis,
String grpcBindAddress,
@Nullable Integer grpcHttpPort,
@Nullable Integer grpcHttpsPort,
String uiBindAddress,
int uiPort,
boolean uiHttps,
String uiContextPath,
ImmutableMap jgroupsProperties) {
this.cassandraContactPoint = cassandraContactPoint;
this.cassandraUsername = cassandraUsername;
this.cassandraPassword = cassandraPassword;
this.cassandraKeyspace = cassandraKeyspace;
this.cassandraConsistencyLevel = cassandraConsistencyLevel;
this.cassandraSymmetricEncryptionKey = cassandraSymmetricEncryptionKey;
this.cassandraPoolMaxRequestsPerConnection = cassandraPoolMaxRequestsPerConnection;
this.cassandraPoolMaxQueueSize = cassandraPoolMaxQueueSize;
this.cassandraPoolTimeoutMillis = cassandraPoolTimeoutMillis;
this.grpcBindAddress = grpcBindAddress;
this.grpcHttpPort = grpcHttpPort;
this.grpcHttpsPort = grpcHttpsPort;
this.uiBindAddress = uiBindAddress;
this.uiPort = uiPort;
this.uiHttps = uiHttps;
this.uiContextPath = uiContextPath;
this.jgroupsProperties = jgroupsProperties;
this.initShim = null;
}
private static final int STAGE_INITIALIZING = -1;
private static final int STAGE_UNINITIALIZED = 0;
private static final int STAGE_INITIALIZED = 1;
private transient volatile InitShim initShim = new InitShim();
private final class InitShim {
private ImmutableList cassandraContactPoint;
private int cassandraContactPointBuildStage;
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 String cassandraUsername;
private int cassandraUsernameBuildStage;
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 String cassandraPassword;
private int cassandraPasswordBuildStage;
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 String cassandraKeyspace;
private int cassandraKeyspaceBuildStage;
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 ConsistencyLevel cassandraConsistencyLevel;
private int cassandraConsistencyLevelBuildStage;
ConsistencyLevel cassandraConsistencyLevel() {
if (cassandraConsistencyLevelBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (cassandraConsistencyLevelBuildStage == STAGE_UNINITIALIZED) {
cassandraConsistencyLevelBuildStage = STAGE_INITIALIZING;
this.cassandraConsistencyLevel = Objects.requireNonNull(ImmutableCentralConfiguration.super.cassandraConsistencyLevel(), "cassandraConsistencyLevel");
cassandraConsistencyLevelBuildStage = STAGE_INITIALIZED;
}
return this.cassandraConsistencyLevel;
}
void cassandraConsistencyLevel(ConsistencyLevel cassandraConsistencyLevel) {
this.cassandraConsistencyLevel = cassandraConsistencyLevel;
cassandraConsistencyLevelBuildStage = STAGE_INITIALIZED;
}
private String cassandraSymmetricEncryptionKey;
private int cassandraSymmetricEncryptionKeyBuildStage;
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 int cassandraPoolMaxRequestsPerConnection;
private int cassandraPoolMaxRequestsPerConnectionBuildStage;
int cassandraPoolMaxRequestsPerConnection() {
if (cassandraPoolMaxRequestsPerConnectionBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (cassandraPoolMaxRequestsPerConnectionBuildStage == STAGE_UNINITIALIZED) {
cassandraPoolMaxRequestsPerConnectionBuildStage = STAGE_INITIALIZING;
this.cassandraPoolMaxRequestsPerConnection = ImmutableCentralConfiguration.super.cassandraPoolMaxRequestsPerConnection();
cassandraPoolMaxRequestsPerConnectionBuildStage = STAGE_INITIALIZED;
}
return this.cassandraPoolMaxRequestsPerConnection;
}
void cassandraPoolMaxRequestsPerConnection(int cassandraPoolMaxRequestsPerConnection) {
this.cassandraPoolMaxRequestsPerConnection = cassandraPoolMaxRequestsPerConnection;
cassandraPoolMaxRequestsPerConnectionBuildStage = STAGE_INITIALIZED;
}
private int cassandraPoolMaxQueueSize;
private int cassandraPoolMaxQueueSizeBuildStage;
int cassandraPoolMaxQueueSize() {
if (cassandraPoolMaxQueueSizeBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (cassandraPoolMaxQueueSizeBuildStage == STAGE_UNINITIALIZED) {
cassandraPoolMaxQueueSizeBuildStage = STAGE_INITIALIZING;
this.cassandraPoolMaxQueueSize = ImmutableCentralConfiguration.super.cassandraPoolMaxQueueSize();
cassandraPoolMaxQueueSizeBuildStage = STAGE_INITIALIZED;
}
return this.cassandraPoolMaxQueueSize;
}
void cassandraPoolMaxQueueSize(int cassandraPoolMaxQueueSize) {
this.cassandraPoolMaxQueueSize = cassandraPoolMaxQueueSize;
cassandraPoolMaxQueueSizeBuildStage = STAGE_INITIALIZED;
}
private int cassandraPoolTimeoutMillis;
private int cassandraPoolTimeoutMillisBuildStage;
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 String grpcBindAddress;
private int grpcBindAddressBuildStage;
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 Integer grpcHttpPort;
private int grpcHttpPortBuildStage;
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(Integer grpcHttpPort) {
this.grpcHttpPort = grpcHttpPort;
grpcHttpPortBuildStage = STAGE_INITIALIZED;
}
private Integer grpcHttpsPort;
private int grpcHttpsPortBuildStage;
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(Integer grpcHttpsPort) {
this.grpcHttpsPort = grpcHttpsPort;
grpcHttpsPortBuildStage = STAGE_INITIALIZED;
}
private String uiBindAddress;
private int uiBindAddressBuildStage;
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 int uiPort;
private int uiPortBuildStage;
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 boolean uiHttps;
private int uiHttpsBuildStage;
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 String uiContextPath;
private int uiContextPathBuildStage;
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() {
ArrayList attributes = Lists.newArrayList();
if (cassandraContactPointBuildStage == STAGE_INITIALIZING) attributes.add("cassandraContactPoint");
if (cassandraUsernameBuildStage == STAGE_INITIALIZING) attributes.add("cassandraUsername");
if (cassandraPasswordBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPassword");
if (cassandraKeyspaceBuildStage == STAGE_INITIALIZING) attributes.add("cassandraKeyspace");
if (cassandraConsistencyLevelBuildStage == STAGE_INITIALIZING) attributes.add("cassandraConsistencyLevel");
if (cassandraSymmetricEncryptionKeyBuildStage == STAGE_INITIALIZING) attributes.add("cassandraSymmetricEncryptionKey");
if (cassandraPoolMaxRequestsPerConnectionBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPoolMaxRequestsPerConnection");
if (cassandraPoolMaxQueueSizeBuildStage == STAGE_INITIALIZING) attributes.add("cassandraPoolMaxQueueSize");
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 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 cassandraKeyspace} attribute
*/
@JsonProperty("cassandraKeyspace")
@Override
String cassandraKeyspace() {
InitShim shim = this.initShim;
return shim != null
? shim.cassandraKeyspace()
: this.cassandraKeyspace;
}
/**
* @return The value of the {@code cassandraConsistencyLevel} attribute
*/
@JsonProperty("cassandraConsistencyLevel")
@Override
ConsistencyLevel cassandraConsistencyLevel() {
InitShim shim = this.initShim;
return shim != null
? shim.cassandraConsistencyLevel()
: this.cassandraConsistencyLevel;
}
/**
* @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 cassandraPoolMaxRequestsPerConnection} attribute
*/
@JsonProperty("cassandraPoolMaxRequestsPerConnection")
@Override
int cassandraPoolMaxRequestsPerConnection() {
InitShim shim = this.initShim;
return shim != null
? shim.cassandraPoolMaxRequestsPerConnection()
: this.cassandraPoolMaxRequestsPerConnection;
}
/**
* @return The value of the {@code cassandraPoolMaxQueueSize} attribute
*/
@JsonProperty("cassandraPoolMaxQueueSize")
@Override
int cassandraPoolMaxQueueSize() {
InitShim shim = this.initShim;
return shim != null
? shim.cassandraPoolMaxQueueSize()
: this.cassandraPoolMaxQueueSize;
}
/**
* @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
@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
@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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.cassandraUsername.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "cassandraUsername");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
newValue,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.cassandraPassword.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "cassandraPassword");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
newValue,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.cassandraKeyspace.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "cassandraKeyspace");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
newValue,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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#cassandraConsistencyLevel() cassandraConsistencyLevel} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for cassandraConsistencyLevel
* @return A modified copy of the {@code this} object
*/
public final ImmutableCentralConfiguration withCassandraConsistencyLevel(ConsistencyLevel value) {
if (this.cassandraConsistencyLevel == value) return this;
ConsistencyLevel newValue = Objects.requireNonNull(value, "cassandraConsistencyLevel");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
newValue,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.cassandraSymmetricEncryptionKey.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "cassandraSymmetricEncryptionKey");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
newValue,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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#cassandraPoolMaxRequestsPerConnection() cassandraPoolMaxRequestsPerConnection} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for cassandraPoolMaxRequestsPerConnection
* @return A modified copy of the {@code this} object
*/
public final ImmutableCentralConfiguration withCassandraPoolMaxRequestsPerConnection(int value) {
if (this.cassandraPoolMaxRequestsPerConnection == value) return this;
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
value,
this.cassandraPoolMaxQueueSize,
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#cassandraPoolMaxQueueSize() cassandraPoolMaxQueueSize} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for cassandraPoolMaxQueueSize
* @return A modified copy of the {@code this} object
*/
public final ImmutableCentralConfiguration withCassandraPoolMaxQueueSize(int value) {
if (this.cassandraPoolMaxQueueSize == value) return this;
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.grpcBindAddress.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "grpcBindAddress");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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(@Nullable Integer value) {
if (Objects.equals(this.grpcHttpPort, value)) return this;
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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(@Nullable Integer value) {
if (Objects.equals(this.grpcHttpsPort, value)) return this;
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.uiBindAddress.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "uiBindAddress");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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) {
if (this.uiContextPath.equals(value)) return this;
String newValue = Objects.requireNonNull(value, "uiContextPath");
return new ImmutableCentralConfiguration(
this.cassandraContactPoint,
this.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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.cassandraUsername,
this.cassandraPassword,
this.cassandraKeyspace,
this.cassandraConsistencyLevel,
this.cassandraSymmetricEncryptionKey,
this.cassandraPoolMaxRequestsPerConnection,
this.cassandraPoolMaxQueueSize,
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)
&& cassandraUsername.equals(another.cassandraUsername)
&& cassandraPassword.equals(another.cassandraPassword)
&& cassandraKeyspace.equals(another.cassandraKeyspace)
&& cassandraConsistencyLevel.equals(another.cassandraConsistencyLevel)
&& cassandraSymmetricEncryptionKey.equals(another.cassandraSymmetricEncryptionKey)
&& cassandraPoolMaxRequestsPerConnection == another.cassandraPoolMaxRequestsPerConnection
&& cassandraPoolMaxQueueSize == another.cassandraPoolMaxQueueSize
&& 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 cassandraUsername}, {@code cassandraPassword}, {@code cassandraKeyspace}, {@code cassandraConsistencyLevel}, {@code cassandraSymmetricEncryptionKey}, {@code cassandraPoolMaxRequestsPerConnection}, {@code cassandraPoolMaxQueueSize}, {@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() {
int h = 5381;
h += (h << 5) + cassandraContactPoint.hashCode();
h += (h << 5) + cassandraUsername.hashCode();
h += (h << 5) + cassandraPassword.hashCode();
h += (h << 5) + cassandraKeyspace.hashCode();
h += (h << 5) + cassandraConsistencyLevel.hashCode();
h += (h << 5) + cassandraSymmetricEncryptionKey.hashCode();
h += (h << 5) + cassandraPoolMaxRequestsPerConnection;
h += (h << 5) + cassandraPoolMaxQueueSize;
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("cassandraUsername", cassandraUsername)
.add("cassandraPassword", cassandraPassword)
.add("cassandraKeyspace", cassandraKeyspace)
.add("cassandraConsistencyLevel", cassandraConsistencyLevel)
.add("cassandraSymmetricEncryptionKey", cassandraSymmetricEncryptionKey)
.add("cassandraPoolMaxRequestsPerConnection", cassandraPoolMaxRequestsPerConnection)
.add("cassandraPoolMaxQueueSize", cassandraPoolMaxQueueSize)
.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
*/
@Deprecated
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE)
static final class Json extends CentralModule.CentralConfiguration {
@javax.annotation.Nullable List cassandraContactPoint = ImmutableList.of();
boolean cassandraContactPointIsSet;
@javax.annotation.Nullable String cassandraUsername;
@javax.annotation.Nullable String cassandraPassword;
@javax.annotation.Nullable String cassandraKeyspace;
@javax.annotation.Nullable ConsistencyLevel cassandraConsistencyLevel;
@javax.annotation.Nullable String cassandraSymmetricEncryptionKey;
int cassandraPoolMaxRequestsPerConnection;
boolean cassandraPoolMaxRequestsPerConnectionIsSet;
int cassandraPoolMaxQueueSize;
boolean cassandraPoolMaxQueueSizeIsSet;
int cassandraPoolTimeoutMillis;
boolean cassandraPoolTimeoutMillisIsSet;
@javax.annotation.Nullable String grpcBindAddress;
@javax.annotation.Nullable Integer grpcHttpPort;
boolean grpcHttpPortIsSet;
@javax.annotation.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("cassandraUsername")
public void setCassandraUsername(String cassandraUsername) {
this.cassandraUsername = cassandraUsername;
}
@JsonProperty("cassandraPassword")
public void setCassandraPassword(String cassandraPassword) {
this.cassandraPassword = cassandraPassword;
}
@JsonProperty("cassandraKeyspace")
public void setCassandraKeyspace(String cassandraKeyspace) {
this.cassandraKeyspace = cassandraKeyspace;
}
@JsonProperty("cassandraConsistencyLevel")
public void setCassandraConsistencyLevel(ConsistencyLevel cassandraConsistencyLevel) {
this.cassandraConsistencyLevel = cassandraConsistencyLevel;
}
@JsonProperty("cassandraSymmetricEncryptionKey")
public void setCassandraSymmetricEncryptionKey(String cassandraSymmetricEncryptionKey) {
this.cassandraSymmetricEncryptionKey = cassandraSymmetricEncryptionKey;
}
@JsonProperty("cassandraPoolMaxRequestsPerConnection")
public void setCassandraPoolMaxRequestsPerConnection(int cassandraPoolMaxRequestsPerConnection) {
this.cassandraPoolMaxRequestsPerConnection = cassandraPoolMaxRequestsPerConnection;
this.cassandraPoolMaxRequestsPerConnectionIsSet = true;
}
@JsonProperty("cassandraPoolMaxQueueSize")
public void setCassandraPoolMaxQueueSize(int cassandraPoolMaxQueueSize) {
this.cassandraPoolMaxQueueSize = cassandraPoolMaxQueueSize;
this.cassandraPoolMaxQueueSizeIsSet = 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(@Nullable Integer grpcHttpPort) {
this.grpcHttpPort = grpcHttpPort;
this.grpcHttpPortIsSet = true;
}
@JsonProperty("grpcHttpsPort")
public void setGrpcHttpsPort(@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
String cassandraUsername() { throw new UnsupportedOperationException(); }
@Override
String cassandraPassword() { throw new UnsupportedOperationException(); }
@Override
String cassandraKeyspace() { throw new UnsupportedOperationException(); }
@Override
ConsistencyLevel cassandraConsistencyLevel() { throw new UnsupportedOperationException(); }
@Override
String cassandraSymmetricEncryptionKey() { throw new UnsupportedOperationException(); }
@Override
int cassandraPoolMaxRequestsPerConnection() { throw new UnsupportedOperationException(); }
@Override
int cassandraPoolMaxQueueSize() { throw new UnsupportedOperationException(); }
@Override
int cassandraPoolTimeoutMillis() { throw new UnsupportedOperationException(); }
@Override
String grpcBindAddress() { throw new UnsupportedOperationException(); }
@Override
Integer grpcHttpPort() { throw new UnsupportedOperationException(); }
@Override
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.cassandraUsername != null) {
builder.cassandraUsername(json.cassandraUsername);
}
if (json.cassandraPassword != null) {
builder.cassandraPassword(json.cassandraPassword);
}
if (json.cassandraKeyspace != null) {
builder.cassandraKeyspace(json.cassandraKeyspace);
}
if (json.cassandraConsistencyLevel != null) {
builder.cassandraConsistencyLevel(json.cassandraConsistencyLevel);
}
if (json.cassandraSymmetricEncryptionKey != null) {
builder.cassandraSymmetricEncryptionKey(json.cassandraSymmetricEncryptionKey);
}
if (json.cassandraPoolMaxRequestsPerConnectionIsSet) {
builder.cassandraPoolMaxRequestsPerConnection(json.cassandraPoolMaxRequestsPerConnection);
}
if (json.cassandraPoolMaxQueueSizeIsSet) {
builder.cassandraPoolMaxQueueSize(json.cassandraPoolMaxQueueSize);
}
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}.
* @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.
*/
@NotThreadSafe
public static final class Builder {
private static final long OPT_BIT_CASSANDRA_CONTACT_POINT = 0x1L;
private static final long OPT_BIT_CASSANDRA_POOL_MAX_REQUESTS_PER_CONNECTION = 0x2L;
private static final long OPT_BIT_CASSANDRA_POOL_MAX_QUEUE_SIZE = 0x4L;
private static final long OPT_BIT_CASSANDRA_POOL_TIMEOUT_MILLIS = 0x8L;
private static final long OPT_BIT_GRPC_HTTP_PORT = 0x10L;
private static final long OPT_BIT_GRPC_HTTPS_PORT = 0x20L;
private static final long OPT_BIT_UI_PORT = 0x40L;
private static final long OPT_BIT_UI_HTTPS = 0x80L;
private long optBits;
private ImmutableList.Builder cassandraContactPoint = ImmutableList.builder();
private @javax.annotation.Nullable String cassandraUsername;
private @javax.annotation.Nullable String cassandraPassword;
private @javax.annotation.Nullable String cassandraKeyspace;
private @javax.annotation.Nullable ConsistencyLevel cassandraConsistencyLevel;
private @javax.annotation.Nullable String cassandraSymmetricEncryptionKey;
private int cassandraPoolMaxRequestsPerConnection;
private int cassandraPoolMaxQueueSize;
private int cassandraPoolTimeoutMillis;
private @javax.annotation.Nullable String grpcBindAddress;
private @javax.annotation.Nullable Integer grpcHttpPort;
private @javax.annotation.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());
cassandraUsername(instance.cassandraUsername());
cassandraPassword(instance.cassandraPassword());
cassandraKeyspace(instance.cassandraKeyspace());
cassandraConsistencyLevel(instance.cassandraConsistencyLevel());
cassandraSymmetricEncryptionKey(instance.cassandraSymmetricEncryptionKey());
cassandraPoolMaxRequestsPerConnection(instance.cassandraPoolMaxRequestsPerConnection());
cassandraPoolMaxQueueSize(instance.cassandraPoolMaxQueueSize());
cassandraPoolTimeoutMillis(instance.cassandraPoolTimeoutMillis());
grpcBindAddress(instance.grpcBindAddress());
@Nullable Integer grpcHttpPortValue = instance.grpcHttpPort();
if (grpcHttpPortValue != null) {
grpcHttpPort(grpcHttpPortValue);
}
@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#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#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#cassandraConsistencyLevel() cassandraConsistencyLevel} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraConsistencyLevel() cassandraConsistencyLevel}.
* @param cassandraConsistencyLevel The value for cassandraConsistencyLevel
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder cassandraConsistencyLevel(ConsistencyLevel cassandraConsistencyLevel) {
this.cassandraConsistencyLevel = Objects.requireNonNull(cassandraConsistencyLevel, "cassandraConsistencyLevel");
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#cassandraPoolMaxRequestsPerConnection() cassandraPoolMaxRequestsPerConnection} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraPoolMaxRequestsPerConnection() cassandraPoolMaxRequestsPerConnection}.
* @param cassandraPoolMaxRequestsPerConnection The value for cassandraPoolMaxRequestsPerConnection
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder cassandraPoolMaxRequestsPerConnection(int cassandraPoolMaxRequestsPerConnection) {
this.cassandraPoolMaxRequestsPerConnection = cassandraPoolMaxRequestsPerConnection;
optBits |= OPT_BIT_CASSANDRA_POOL_MAX_REQUESTS_PER_CONNECTION;
return this;
}
/**
* Initializes the value for the {@link CentralModule.CentralConfiguration#cassandraPoolMaxQueueSize() cassandraPoolMaxQueueSize} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link CentralModule.CentralConfiguration#cassandraPoolMaxQueueSize() cassandraPoolMaxQueueSize}.
* @param cassandraPoolMaxQueueSize The value for cassandraPoolMaxQueueSize
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder cassandraPoolMaxQueueSize(int cassandraPoolMaxQueueSize) {
this.cassandraPoolMaxQueueSize = cassandraPoolMaxQueueSize;
optBits |= OPT_BIT_CASSANDRA_POOL_MAX_QUEUE_SIZE;
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(@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(@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 jgroupsProperties 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 jgroupsProperties) {
this.jgroupsProperties = ImmutableMap.builder();
return putAllJgroupsProperties(jgroupsProperties);
}
/**
* Put all mappings from the specified map as entries to {@link CentralModule.CentralConfiguration#jgroupsProperties() jgroupsProperties} map. Nulls are not permitted
* @param jgroupsProperties 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 jgroupsProperties) {
this.jgroupsProperties.putAll(jgroupsProperties);
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 cassandraPoolMaxRequestsPerConnectionIsSet() {
return (optBits & OPT_BIT_CASSANDRA_POOL_MAX_REQUESTS_PER_CONNECTION) != 0;
}
private boolean cassandraPoolMaxQueueSizeIsSet() {
return (optBits & OPT_BIT_CASSANDRA_POOL_MAX_QUEUE_SIZE) != 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;
}
}
}