org.glowroot.agent.config.ImmutableAdvancedConfig Maven / Gradle / Ivy
Show all versions of glowroot-agent-it-harness Show documentation
package org.glowroot.agent.config;
import org.glowroot.agent.shaded.com.fasterxml.jackson.annotation.JsonAutoDetect;
import org.glowroot.agent.shaded.com.fasterxml.jackson.annotation.JsonCreator;
import org.glowroot.agent.shaded.com.fasterxml.jackson.annotation.JsonInclude;
import org.glowroot.agent.shaded.com.fasterxml.jackson.annotation.JsonProperty;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.com.google.common.base.MoreObjects;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.com.google.common.base.Preconditions;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.com.google.common.collect.Lists;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.com.google.common.primitives.Booleans;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.ArrayList;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.CheckReturnValue;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.Generated;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.Nullable;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.ParametersAreNonnullByDefault;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.concurrent.Immutable;
import org.glowroot.agent.shaded.org.glowroot.agent.it.harness.shaded.javax.annotation.concurrent.NotThreadSafe;
/**
* Immutable implementation of {@link AdvancedConfig}.
*
* Use the builder to create immutable instances:
* {@code ImmutableAdvancedConfig.builder()}.
*/
@SuppressWarnings({"all"})
@ParametersAreNonnullByDefault
@Generated({"Immutables.generator", "AdvancedConfig"})
@Immutable
@CheckReturnValue
public final class ImmutableAdvancedConfig extends AdvancedConfig {
private final boolean weavingTimer;
private final int immediatePartialStoreThresholdSeconds;
private final int maxTransactionAggregates;
private final int maxQueryAggregates;
private final int maxServiceCallAggregates;
private final int maxTraceEntriesPerTransaction;
private final int maxProfileSamplesPerTransaction;
private final int mbeanGaugeNotFoundDelaySeconds;
private ImmutableAdvancedConfig(ImmutableAdvancedConfig.Builder builder) {
if (builder.weavingTimerIsSet()) {
initShim.weavingTimer(builder.weavingTimer);
}
if (builder.immediatePartialStoreThresholdSecondsIsSet()) {
initShim.immediatePartialStoreThresholdSeconds(builder.immediatePartialStoreThresholdSeconds);
}
if (builder.maxTransactionAggregatesIsSet()) {
initShim.maxTransactionAggregates(builder.maxTransactionAggregates);
}
if (builder.maxQueryAggregatesIsSet()) {
initShim.maxQueryAggregates(builder.maxQueryAggregates);
}
if (builder.maxServiceCallAggregatesIsSet()) {
initShim.maxServiceCallAggregates(builder.maxServiceCallAggregates);
}
if (builder.maxTraceEntriesPerTransactionIsSet()) {
initShim.maxTraceEntriesPerTransaction(builder.maxTraceEntriesPerTransaction);
}
if (builder.maxProfileSamplesPerTransactionIsSet()) {
initShim.maxProfileSamplesPerTransaction(builder.maxProfileSamplesPerTransaction);
}
if (builder.mbeanGaugeNotFoundDelaySecondsIsSet()) {
initShim.mbeanGaugeNotFoundDelaySeconds(builder.mbeanGaugeNotFoundDelaySeconds);
}
this.weavingTimer = initShim.weavingTimer();
this.immediatePartialStoreThresholdSeconds = initShim.immediatePartialStoreThresholdSeconds();
this.maxTransactionAggregates = initShim.maxTransactionAggregates();
this.maxQueryAggregates = initShim.maxQueryAggregates();
this.maxServiceCallAggregates = initShim.maxServiceCallAggregates();
this.maxTraceEntriesPerTransaction = initShim.maxTraceEntriesPerTransaction();
this.maxProfileSamplesPerTransaction = initShim.maxProfileSamplesPerTransaction();
this.mbeanGaugeNotFoundDelaySeconds = initShim.mbeanGaugeNotFoundDelaySeconds();
this.initShim = null;
}
private ImmutableAdvancedConfig(
boolean weavingTimer,
int immediatePartialStoreThresholdSeconds,
int maxTransactionAggregates,
int maxQueryAggregates,
int maxServiceCallAggregates,
int maxTraceEntriesPerTransaction,
int maxProfileSamplesPerTransaction,
int mbeanGaugeNotFoundDelaySeconds) {
this.weavingTimer = weavingTimer;
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
this.maxTransactionAggregates = maxTransactionAggregates;
this.maxQueryAggregates = maxQueryAggregates;
this.maxServiceCallAggregates = maxServiceCallAggregates;
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
this.maxProfileSamplesPerTransaction = maxProfileSamplesPerTransaction;
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
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 boolean weavingTimer;
private int weavingTimerBuildStage;
boolean weavingTimer() {
if (weavingTimerBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (weavingTimerBuildStage == STAGE_UNINITIALIZED) {
weavingTimerBuildStage = STAGE_INITIALIZING;
this.weavingTimer = ImmutableAdvancedConfig.super.weavingTimer();
weavingTimerBuildStage = STAGE_INITIALIZED;
}
return this.weavingTimer;
}
void weavingTimer(boolean weavingTimer) {
this.weavingTimer = weavingTimer;
weavingTimerBuildStage = STAGE_INITIALIZED;
}
private int immediatePartialStoreThresholdSeconds;
private int immediatePartialStoreThresholdSecondsBuildStage;
int immediatePartialStoreThresholdSeconds() {
if (immediatePartialStoreThresholdSecondsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (immediatePartialStoreThresholdSecondsBuildStage == STAGE_UNINITIALIZED) {
immediatePartialStoreThresholdSecondsBuildStage = STAGE_INITIALIZING;
this.immediatePartialStoreThresholdSeconds = ImmutableAdvancedConfig.super.immediatePartialStoreThresholdSeconds();
immediatePartialStoreThresholdSecondsBuildStage = STAGE_INITIALIZED;
}
return this.immediatePartialStoreThresholdSeconds;
}
void immediatePartialStoreThresholdSeconds(int immediatePartialStoreThresholdSeconds) {
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
immediatePartialStoreThresholdSecondsBuildStage = STAGE_INITIALIZED;
}
private int maxTransactionAggregates;
private int maxTransactionAggregatesBuildStage;
int maxTransactionAggregates() {
if (maxTransactionAggregatesBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxTransactionAggregatesBuildStage == STAGE_UNINITIALIZED) {
maxTransactionAggregatesBuildStage = STAGE_INITIALIZING;
this.maxTransactionAggregates = ImmutableAdvancedConfig.super.maxTransactionAggregates();
maxTransactionAggregatesBuildStage = STAGE_INITIALIZED;
}
return this.maxTransactionAggregates;
}
void maxTransactionAggregates(int maxTransactionAggregates) {
this.maxTransactionAggregates = maxTransactionAggregates;
maxTransactionAggregatesBuildStage = STAGE_INITIALIZED;
}
private int maxQueryAggregates;
private int maxQueryAggregatesBuildStage;
int maxQueryAggregates() {
if (maxQueryAggregatesBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxQueryAggregatesBuildStage == STAGE_UNINITIALIZED) {
maxQueryAggregatesBuildStage = STAGE_INITIALIZING;
this.maxQueryAggregates = ImmutableAdvancedConfig.super.maxQueryAggregates();
maxQueryAggregatesBuildStage = STAGE_INITIALIZED;
}
return this.maxQueryAggregates;
}
void maxQueryAggregates(int maxQueryAggregates) {
this.maxQueryAggregates = maxQueryAggregates;
maxQueryAggregatesBuildStage = STAGE_INITIALIZED;
}
private int maxServiceCallAggregates;
private int maxServiceCallAggregatesBuildStage;
int maxServiceCallAggregates() {
if (maxServiceCallAggregatesBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxServiceCallAggregatesBuildStage == STAGE_UNINITIALIZED) {
maxServiceCallAggregatesBuildStage = STAGE_INITIALIZING;
this.maxServiceCallAggregates = ImmutableAdvancedConfig.super.maxServiceCallAggregates();
maxServiceCallAggregatesBuildStage = STAGE_INITIALIZED;
}
return this.maxServiceCallAggregates;
}
void maxServiceCallAggregates(int maxServiceCallAggregates) {
this.maxServiceCallAggregates = maxServiceCallAggregates;
maxServiceCallAggregatesBuildStage = STAGE_INITIALIZED;
}
private int maxTraceEntriesPerTransaction;
private int maxTraceEntriesPerTransactionBuildStage;
int maxTraceEntriesPerTransaction() {
if (maxTraceEntriesPerTransactionBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxTraceEntriesPerTransactionBuildStage == STAGE_UNINITIALIZED) {
maxTraceEntriesPerTransactionBuildStage = STAGE_INITIALIZING;
this.maxTraceEntriesPerTransaction = ImmutableAdvancedConfig.super.maxTraceEntriesPerTransaction();
maxTraceEntriesPerTransactionBuildStage = STAGE_INITIALIZED;
}
return this.maxTraceEntriesPerTransaction;
}
void maxTraceEntriesPerTransaction(int maxTraceEntriesPerTransaction) {
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
maxTraceEntriesPerTransactionBuildStage = STAGE_INITIALIZED;
}
private int maxProfileSamplesPerTransaction;
private int maxProfileSamplesPerTransactionBuildStage;
int maxProfileSamplesPerTransaction() {
if (maxProfileSamplesPerTransactionBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxProfileSamplesPerTransactionBuildStage == STAGE_UNINITIALIZED) {
maxProfileSamplesPerTransactionBuildStage = STAGE_INITIALIZING;
this.maxProfileSamplesPerTransaction = ImmutableAdvancedConfig.super.maxProfileSamplesPerTransaction();
maxProfileSamplesPerTransactionBuildStage = STAGE_INITIALIZED;
}
return this.maxProfileSamplesPerTransaction;
}
void maxProfileSamplesPerTransaction(int maxProfileSamplesPerTransaction) {
this.maxProfileSamplesPerTransaction = maxProfileSamplesPerTransaction;
maxProfileSamplesPerTransactionBuildStage = STAGE_INITIALIZED;
}
private int mbeanGaugeNotFoundDelaySeconds;
private int mbeanGaugeNotFoundDelaySecondsBuildStage;
int mbeanGaugeNotFoundDelaySeconds() {
if (mbeanGaugeNotFoundDelaySecondsBuildStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (mbeanGaugeNotFoundDelaySecondsBuildStage == STAGE_UNINITIALIZED) {
mbeanGaugeNotFoundDelaySecondsBuildStage = STAGE_INITIALIZING;
this.mbeanGaugeNotFoundDelaySeconds = ImmutableAdvancedConfig.super.mbeanGaugeNotFoundDelaySeconds();
mbeanGaugeNotFoundDelaySecondsBuildStage = STAGE_INITIALIZED;
}
return this.mbeanGaugeNotFoundDelaySeconds;
}
void mbeanGaugeNotFoundDelaySeconds(int mbeanGaugeNotFoundDelaySeconds) {
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
mbeanGaugeNotFoundDelaySecondsBuildStage = STAGE_INITIALIZED;
}
private String formatInitCycleMessage() {
ArrayList attributes = Lists.newArrayList();
if (weavingTimerBuildStage == STAGE_INITIALIZING) attributes.add("weavingTimer");
if (immediatePartialStoreThresholdSecondsBuildStage == STAGE_INITIALIZING) attributes.add("immediatePartialStoreThresholdSeconds");
if (maxTransactionAggregatesBuildStage == STAGE_INITIALIZING) attributes.add("maxTransactionAggregates");
if (maxQueryAggregatesBuildStage == STAGE_INITIALIZING) attributes.add("maxQueryAggregates");
if (maxServiceCallAggregatesBuildStage == STAGE_INITIALIZING) attributes.add("maxServiceCallAggregates");
if (maxTraceEntriesPerTransactionBuildStage == STAGE_INITIALIZING) attributes.add("maxTraceEntriesPerTransaction");
if (maxProfileSamplesPerTransactionBuildStage == STAGE_INITIALIZING) attributes.add("maxProfileSamplesPerTransaction");
if (mbeanGaugeNotFoundDelaySecondsBuildStage == STAGE_INITIALIZING) attributes.add("mbeanGaugeNotFoundDelaySeconds");
return "Cannot build AdvancedConfig, attribute initializers form cycle" + attributes;
}
}
/**
* @return The value of the {@code weavingTimer} attribute
*/
@JsonProperty("weavingTimer")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Override
public boolean weavingTimer() {
InitShim shim = this.initShim;
return shim != null
? shim.weavingTimer()
: this.weavingTimer;
}
/**
* @return The value of the {@code immediatePartialStoreThresholdSeconds} attribute
*/
@JsonProperty("immediatePartialStoreThresholdSeconds")
@Override
public int immediatePartialStoreThresholdSeconds() {
InitShim shim = this.initShim;
return shim != null
? shim.immediatePartialStoreThresholdSeconds()
: this.immediatePartialStoreThresholdSeconds;
}
/**
* @return The value of the {@code maxTransactionAggregates} attribute
*/
@JsonProperty("maxTransactionAggregates")
@Override
public int maxTransactionAggregates() {
InitShim shim = this.initShim;
return shim != null
? shim.maxTransactionAggregates()
: this.maxTransactionAggregates;
}
/**
* @return The value of the {@code maxQueryAggregates} attribute
*/
@JsonProperty("maxQueryAggregates")
@Override
public int maxQueryAggregates() {
InitShim shim = this.initShim;
return shim != null
? shim.maxQueryAggregates()
: this.maxQueryAggregates;
}
/**
* @return The value of the {@code maxServiceCallAggregates} attribute
*/
@JsonProperty("maxServiceCallAggregates")
@Override
public int maxServiceCallAggregates() {
InitShim shim = this.initShim;
return shim != null
? shim.maxServiceCallAggregates()
: this.maxServiceCallAggregates;
}
/**
* @return The value of the {@code maxTraceEntriesPerTransaction} attribute
*/
@JsonProperty("maxTraceEntriesPerTransaction")
@Override
public int maxTraceEntriesPerTransaction() {
InitShim shim = this.initShim;
return shim != null
? shim.maxTraceEntriesPerTransaction()
: this.maxTraceEntriesPerTransaction;
}
/**
* @return The value of the {@code maxProfileSamplesPerTransaction} attribute
*/
@JsonProperty("maxProfileSamplesPerTransaction")
@Override
public int maxProfileSamplesPerTransaction() {
InitShim shim = this.initShim;
return shim != null
? shim.maxProfileSamplesPerTransaction()
: this.maxProfileSamplesPerTransaction;
}
/**
* @return The value of the {@code mbeanGaugeNotFoundDelaySeconds} attribute
*/
@JsonProperty("mbeanGaugeNotFoundDelaySeconds")
@Override
public int mbeanGaugeNotFoundDelaySeconds() {
InitShim shim = this.initShim;
return shim != null
? shim.mbeanGaugeNotFoundDelaySeconds()
: this.mbeanGaugeNotFoundDelaySeconds;
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#weavingTimer() weavingTimer} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for weavingTimer
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withWeavingTimer(boolean value) {
if (this.weavingTimer == value) return this;
return new ImmutableAdvancedConfig(
value,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#immediatePartialStoreThresholdSeconds() immediatePartialStoreThresholdSeconds} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for immediatePartialStoreThresholdSeconds
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withImmediatePartialStoreThresholdSeconds(int value) {
if (this.immediatePartialStoreThresholdSeconds == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
value,
this.maxTransactionAggregates,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxTransactionAggregates() maxTransactionAggregates} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxTransactionAggregates
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxTransactionAggregates(int value) {
if (this.maxTransactionAggregates == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
value,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxQueryAggregates() maxQueryAggregates} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxQueryAggregates
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxQueryAggregates(int value) {
if (this.maxQueryAggregates == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
value,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxServiceCallAggregates() maxServiceCallAggregates} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxServiceCallAggregates
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxServiceCallAggregates(int value) {
if (this.maxServiceCallAggregates == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
this.maxQueryAggregates,
value,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxTraceEntriesPerTransaction() maxTraceEntriesPerTransaction} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxTraceEntriesPerTransaction
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxTraceEntriesPerTransaction(int value) {
if (this.maxTraceEntriesPerTransaction == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
value,
this.maxProfileSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxProfileSamplesPerTransaction() maxProfileSamplesPerTransaction} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxProfileSamplesPerTransaction
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxProfileSamplesPerTransaction(int value) {
if (this.maxProfileSamplesPerTransaction == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
value,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#mbeanGaugeNotFoundDelaySeconds() mbeanGaugeNotFoundDelaySeconds} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for mbeanGaugeNotFoundDelaySeconds
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMbeanGaugeNotFoundDelaySeconds(int value) {
if (this.mbeanGaugeNotFoundDelaySeconds == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxTransactionAggregates,
this.maxQueryAggregates,
this.maxServiceCallAggregates,
this.maxTraceEntriesPerTransaction,
this.maxProfileSamplesPerTransaction,
value);
}
/**
* This instance is equal to all instances of {@code ImmutableAdvancedConfig} that have equal attribute values.
* @return {@code true} if {@code this} is equal to {@code another} instance
*/
@Override
public boolean equals(@Nullable Object another) {
if (this == another) return true;
return another instanceof ImmutableAdvancedConfig
&& equalTo((ImmutableAdvancedConfig) another);
}
private boolean equalTo(ImmutableAdvancedConfig another) {
return weavingTimer == another.weavingTimer
&& immediatePartialStoreThresholdSeconds == another.immediatePartialStoreThresholdSeconds
&& maxTransactionAggregates == another.maxTransactionAggregates
&& maxQueryAggregates == another.maxQueryAggregates
&& maxServiceCallAggregates == another.maxServiceCallAggregates
&& maxTraceEntriesPerTransaction == another.maxTraceEntriesPerTransaction
&& maxProfileSamplesPerTransaction == another.maxProfileSamplesPerTransaction
&& mbeanGaugeNotFoundDelaySeconds == another.mbeanGaugeNotFoundDelaySeconds;
}
/**
* Computes a hash code from attributes: {@code weavingTimer}, {@code immediatePartialStoreThresholdSeconds}, {@code maxTransactionAggregates}, {@code maxQueryAggregates}, {@code maxServiceCallAggregates}, {@code maxTraceEntriesPerTransaction}, {@code maxProfileSamplesPerTransaction}, {@code mbeanGaugeNotFoundDelaySeconds}.
* @return hashCode value
*/
@Override
public int hashCode() {
int h = 5381;
h += (h << 5) + Booleans.hashCode(weavingTimer);
h += (h << 5) + immediatePartialStoreThresholdSeconds;
h += (h << 5) + maxTransactionAggregates;
h += (h << 5) + maxQueryAggregates;
h += (h << 5) + maxServiceCallAggregates;
h += (h << 5) + maxTraceEntriesPerTransaction;
h += (h << 5) + maxProfileSamplesPerTransaction;
h += (h << 5) + mbeanGaugeNotFoundDelaySeconds;
return h;
}
/**
* Prints the immutable value {@code AdvancedConfig} with attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return MoreObjects.toStringHelper("AdvancedConfig")
.omitNullValues()
.add("weavingTimer", weavingTimer)
.add("immediatePartialStoreThresholdSeconds", immediatePartialStoreThresholdSeconds)
.add("maxTransactionAggregates", maxTransactionAggregates)
.add("maxQueryAggregates", maxQueryAggregates)
.add("maxServiceCallAggregates", maxServiceCallAggregates)
.add("maxTraceEntriesPerTransaction", maxTraceEntriesPerTransaction)
.add("maxProfileSamplesPerTransaction", maxProfileSamplesPerTransaction)
.add("mbeanGaugeNotFoundDelaySeconds", mbeanGaugeNotFoundDelaySeconds)
.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 AdvancedConfig {
boolean weavingTimer;
boolean weavingTimerIsSet;
int immediatePartialStoreThresholdSeconds;
boolean immediatePartialStoreThresholdSecondsIsSet;
int maxTransactionAggregates;
boolean maxTransactionAggregatesIsSet;
int maxQueryAggregates;
boolean maxQueryAggregatesIsSet;
int maxServiceCallAggregates;
boolean maxServiceCallAggregatesIsSet;
int maxTraceEntriesPerTransaction;
boolean maxTraceEntriesPerTransactionIsSet;
int maxProfileSamplesPerTransaction;
boolean maxProfileSamplesPerTransactionIsSet;
int mbeanGaugeNotFoundDelaySeconds;
boolean mbeanGaugeNotFoundDelaySecondsIsSet;
@JsonProperty("weavingTimer")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public void setWeavingTimer(boolean weavingTimer) {
this.weavingTimer = weavingTimer;
this.weavingTimerIsSet = true;
}
@JsonProperty("immediatePartialStoreThresholdSeconds")
public void setImmediatePartialStoreThresholdSeconds(int immediatePartialStoreThresholdSeconds) {
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
this.immediatePartialStoreThresholdSecondsIsSet = true;
}
@JsonProperty("maxTransactionAggregates")
public void setMaxTransactionAggregates(int maxTransactionAggregates) {
this.maxTransactionAggregates = maxTransactionAggregates;
this.maxTransactionAggregatesIsSet = true;
}
@JsonProperty("maxQueryAggregates")
public void setMaxQueryAggregates(int maxQueryAggregates) {
this.maxQueryAggregates = maxQueryAggregates;
this.maxQueryAggregatesIsSet = true;
}
@JsonProperty("maxServiceCallAggregates")
public void setMaxServiceCallAggregates(int maxServiceCallAggregates) {
this.maxServiceCallAggregates = maxServiceCallAggregates;
this.maxServiceCallAggregatesIsSet = true;
}
@JsonProperty("maxTraceEntriesPerTransaction")
public void setMaxTraceEntriesPerTransaction(int maxTraceEntriesPerTransaction) {
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
this.maxTraceEntriesPerTransactionIsSet = true;
}
@JsonProperty("maxProfileSamplesPerTransaction")
public void setMaxProfileSamplesPerTransaction(int maxProfileSamplesPerTransaction) {
this.maxProfileSamplesPerTransaction = maxProfileSamplesPerTransaction;
this.maxProfileSamplesPerTransactionIsSet = true;
}
@JsonProperty("mbeanGaugeNotFoundDelaySeconds")
public void setMbeanGaugeNotFoundDelaySeconds(int mbeanGaugeNotFoundDelaySeconds) {
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
this.mbeanGaugeNotFoundDelaySecondsIsSet = true;
}
@Override
public boolean weavingTimer() { throw new UnsupportedOperationException(); }
@Override
public int immediatePartialStoreThresholdSeconds() { throw new UnsupportedOperationException(); }
@Override
public int maxTransactionAggregates() { throw new UnsupportedOperationException(); }
@Override
public int maxQueryAggregates() { throw new UnsupportedOperationException(); }
@Override
public int maxServiceCallAggregates() { throw new UnsupportedOperationException(); }
@Override
public int maxTraceEntriesPerTransaction() { throw new UnsupportedOperationException(); }
@Override
public int maxProfileSamplesPerTransaction() { throw new UnsupportedOperationException(); }
@Override
public int mbeanGaugeNotFoundDelaySeconds() { 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 ImmutableAdvancedConfig fromJson(Json json) {
ImmutableAdvancedConfig.Builder builder = ImmutableAdvancedConfig.builder();
if (json.weavingTimerIsSet) {
builder.weavingTimer(json.weavingTimer);
}
if (json.immediatePartialStoreThresholdSecondsIsSet) {
builder.immediatePartialStoreThresholdSeconds(json.immediatePartialStoreThresholdSeconds);
}
if (json.maxTransactionAggregatesIsSet) {
builder.maxTransactionAggregates(json.maxTransactionAggregates);
}
if (json.maxQueryAggregatesIsSet) {
builder.maxQueryAggregates(json.maxQueryAggregates);
}
if (json.maxServiceCallAggregatesIsSet) {
builder.maxServiceCallAggregates(json.maxServiceCallAggregates);
}
if (json.maxTraceEntriesPerTransactionIsSet) {
builder.maxTraceEntriesPerTransaction(json.maxTraceEntriesPerTransaction);
}
if (json.maxProfileSamplesPerTransactionIsSet) {
builder.maxProfileSamplesPerTransaction(json.maxProfileSamplesPerTransaction);
}
if (json.mbeanGaugeNotFoundDelaySecondsIsSet) {
builder.mbeanGaugeNotFoundDelaySeconds(json.mbeanGaugeNotFoundDelaySeconds);
}
return builder.build();
}
/**
* Creates an immutable copy of a {@link AdvancedConfig} 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 AdvancedConfig instance
*/
public static ImmutableAdvancedConfig copyOf(AdvancedConfig instance) {
if (instance instanceof ImmutableAdvancedConfig) {
return (ImmutableAdvancedConfig) instance;
}
return ImmutableAdvancedConfig.builder()
.copyFrom(instance)
.build();
}
/**
* Creates a builder for {@link ImmutableAdvancedConfig ImmutableAdvancedConfig}.
* @return A new ImmutableAdvancedConfig builder
*/
public static ImmutableAdvancedConfig.Builder builder() {
return new ImmutableAdvancedConfig.Builder();
}
/**
* Builds instances of type {@link ImmutableAdvancedConfig ImmutableAdvancedConfig}.
* 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_WEAVING_TIMER = 0x1L;
private static final long OPT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS = 0x2L;
private static final long OPT_BIT_MAX_TRANSACTION_AGGREGATES = 0x4L;
private static final long OPT_BIT_MAX_QUERY_AGGREGATES = 0x8L;
private static final long OPT_BIT_MAX_SERVICE_CALL_AGGREGATES = 0x10L;
private static final long OPT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION = 0x20L;
private static final long OPT_BIT_MAX_PROFILE_SAMPLES_PER_TRANSACTION = 0x40L;
private static final long OPT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS = 0x80L;
private long optBits;
private boolean weavingTimer;
private int immediatePartialStoreThresholdSeconds;
private int maxTransactionAggregates;
private int maxQueryAggregates;
private int maxServiceCallAggregates;
private int maxTraceEntriesPerTransaction;
private int maxProfileSamplesPerTransaction;
private int mbeanGaugeNotFoundDelaySeconds;
private Builder() {
}
/**
* Fill a builder with attribute values from the provided {@code AdvancedConfig} instance.
* Regular attribute values will be replaced with those from the given instance.
* Absent optional values will not replace present values.
* @param instance The instance from which to copy values
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder copyFrom(AdvancedConfig instance) {
Preconditions.checkNotNull(instance, "instance");
weavingTimer(instance.weavingTimer());
immediatePartialStoreThresholdSeconds(instance.immediatePartialStoreThresholdSeconds());
maxTransactionAggregates(instance.maxTransactionAggregates());
maxQueryAggregates(instance.maxQueryAggregates());
maxServiceCallAggregates(instance.maxServiceCallAggregates());
maxTraceEntriesPerTransaction(instance.maxTraceEntriesPerTransaction());
maxProfileSamplesPerTransaction(instance.maxProfileSamplesPerTransaction());
mbeanGaugeNotFoundDelaySeconds(instance.mbeanGaugeNotFoundDelaySeconds());
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#weavingTimer() weavingTimer} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#weavingTimer() weavingTimer}.
* @param weavingTimer The value for weavingTimer
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder weavingTimer(boolean weavingTimer) {
this.weavingTimer = weavingTimer;
optBits |= OPT_BIT_WEAVING_TIMER;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#immediatePartialStoreThresholdSeconds() immediatePartialStoreThresholdSeconds} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#immediatePartialStoreThresholdSeconds() immediatePartialStoreThresholdSeconds}.
* @param immediatePartialStoreThresholdSeconds The value for immediatePartialStoreThresholdSeconds
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder immediatePartialStoreThresholdSeconds(int immediatePartialStoreThresholdSeconds) {
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
optBits |= OPT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxTransactionAggregates() maxTransactionAggregates} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxTransactionAggregates() maxTransactionAggregates}.
* @param maxTransactionAggregates The value for maxTransactionAggregates
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder maxTransactionAggregates(int maxTransactionAggregates) {
this.maxTransactionAggregates = maxTransactionAggregates;
optBits |= OPT_BIT_MAX_TRANSACTION_AGGREGATES;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxQueryAggregates() maxQueryAggregates} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxQueryAggregates() maxQueryAggregates}.
* @param maxQueryAggregates The value for maxQueryAggregates
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder maxQueryAggregates(int maxQueryAggregates) {
this.maxQueryAggregates = maxQueryAggregates;
optBits |= OPT_BIT_MAX_QUERY_AGGREGATES;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxServiceCallAggregates() maxServiceCallAggregates} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxServiceCallAggregates() maxServiceCallAggregates}.
* @param maxServiceCallAggregates The value for maxServiceCallAggregates
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder maxServiceCallAggregates(int maxServiceCallAggregates) {
this.maxServiceCallAggregates = maxServiceCallAggregates;
optBits |= OPT_BIT_MAX_SERVICE_CALL_AGGREGATES;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxTraceEntriesPerTransaction() maxTraceEntriesPerTransaction} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxTraceEntriesPerTransaction() maxTraceEntriesPerTransaction}.
* @param maxTraceEntriesPerTransaction The value for maxTraceEntriesPerTransaction
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder maxTraceEntriesPerTransaction(int maxTraceEntriesPerTransaction) {
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
optBits |= OPT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxProfileSamplesPerTransaction() maxProfileSamplesPerTransaction} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxProfileSamplesPerTransaction() maxProfileSamplesPerTransaction}.
* @param maxProfileSamplesPerTransaction The value for maxProfileSamplesPerTransaction
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder maxProfileSamplesPerTransaction(int maxProfileSamplesPerTransaction) {
this.maxProfileSamplesPerTransaction = maxProfileSamplesPerTransaction;
optBits |= OPT_BIT_MAX_PROFILE_SAMPLES_PER_TRANSACTION;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#mbeanGaugeNotFoundDelaySeconds() mbeanGaugeNotFoundDelaySeconds} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#mbeanGaugeNotFoundDelaySeconds() mbeanGaugeNotFoundDelaySeconds}.
* @param mbeanGaugeNotFoundDelaySeconds The value for mbeanGaugeNotFoundDelaySeconds
* @return {@code this} builder for use in a chained invocation
*/
@CanIgnoreReturnValue
public final Builder mbeanGaugeNotFoundDelaySeconds(int mbeanGaugeNotFoundDelaySeconds) {
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
optBits |= OPT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS;
return this;
}
/**
* Builds a new {@link ImmutableAdvancedConfig ImmutableAdvancedConfig}.
* @return An immutable instance of AdvancedConfig
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public ImmutableAdvancedConfig build() {
return new ImmutableAdvancedConfig(this);
}
private boolean weavingTimerIsSet() {
return (optBits & OPT_BIT_WEAVING_TIMER) != 0;
}
private boolean immediatePartialStoreThresholdSecondsIsSet() {
return (optBits & OPT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS) != 0;
}
private boolean maxTransactionAggregatesIsSet() {
return (optBits & OPT_BIT_MAX_TRANSACTION_AGGREGATES) != 0;
}
private boolean maxQueryAggregatesIsSet() {
return (optBits & OPT_BIT_MAX_QUERY_AGGREGATES) != 0;
}
private boolean maxServiceCallAggregatesIsSet() {
return (optBits & OPT_BIT_MAX_SERVICE_CALL_AGGREGATES) != 0;
}
private boolean maxTraceEntriesPerTransactionIsSet() {
return (optBits & OPT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION) != 0;
}
private boolean maxProfileSamplesPerTransactionIsSet() {
return (optBits & OPT_BIT_MAX_PROFILE_SAMPLES_PER_TRANSACTION) != 0;
}
private boolean mbeanGaugeNotFoundDelaySecondsIsSet() {
return (optBits & OPT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS) != 0;
}
}
}