
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.fasterxml.jackson.annotation.JsonCreator;
import org.glowroot.agent.shaded.fasterxml.jackson.annotation.JsonInclude;
import org.glowroot.agent.shaded.fasterxml.jackson.annotation.JsonProperty;
import org.glowroot.agent.shaded.google.common.base.MoreObjects;
import org.glowroot.agent.shaded.google.common.base.Preconditions;
import org.glowroot.agent.shaded.google.common.collect.Lists;
import org.glowroot.agent.shaded.google.common.primitives.Booleans;
import java.util.ArrayList;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import 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
public final class ImmutableAdvancedConfig extends AdvancedConfig {
private final boolean weavingTimer;
private final int immediatePartialStoreThresholdSeconds;
private final int maxAggregateTransactionsPerType;
private final int maxAggregateQueriesPerType;
private final int maxAggregateServiceCallsPerType;
private final int maxTraceEntriesPerTransaction;
private final int maxStackTraceSamplesPerTransaction;
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.maxAggregateTransactionsPerTypeIsSet()) {
initShim.maxAggregateTransactionsPerType(builder.maxAggregateTransactionsPerType);
}
if (builder.maxAggregateQueriesPerTypeIsSet()) {
initShim.maxAggregateQueriesPerType(builder.maxAggregateQueriesPerType);
}
if (builder.maxAggregateServiceCallsPerTypeIsSet()) {
initShim.maxAggregateServiceCallsPerType(builder.maxAggregateServiceCallsPerType);
}
if (builder.maxTraceEntriesPerTransactionIsSet()) {
initShim.maxTraceEntriesPerTransaction(builder.maxTraceEntriesPerTransaction);
}
if (builder.maxStackTraceSamplesPerTransactionIsSet()) {
initShim.maxStackTraceSamplesPerTransaction(builder.maxStackTraceSamplesPerTransaction);
}
if (builder.mbeanGaugeNotFoundDelaySecondsIsSet()) {
initShim.mbeanGaugeNotFoundDelaySeconds(builder.mbeanGaugeNotFoundDelaySeconds);
}
this.weavingTimer = initShim.weavingTimer();
this.immediatePartialStoreThresholdSeconds = initShim.immediatePartialStoreThresholdSeconds();
this.maxAggregateTransactionsPerType = initShim.maxAggregateTransactionsPerType();
this.maxAggregateQueriesPerType = initShim.maxAggregateQueriesPerType();
this.maxAggregateServiceCallsPerType = initShim.maxAggregateServiceCallsPerType();
this.maxTraceEntriesPerTransaction = initShim.maxTraceEntriesPerTransaction();
this.maxStackTraceSamplesPerTransaction = initShim.maxStackTraceSamplesPerTransaction();
this.mbeanGaugeNotFoundDelaySeconds = initShim.mbeanGaugeNotFoundDelaySeconds();
this.initShim = null;
}
private ImmutableAdvancedConfig(
boolean weavingTimer,
int immediatePartialStoreThresholdSeconds,
int maxAggregateTransactionsPerType,
int maxAggregateQueriesPerType,
int maxAggregateServiceCallsPerType,
int maxTraceEntriesPerTransaction,
int maxStackTraceSamplesPerTransaction,
int mbeanGaugeNotFoundDelaySeconds) {
this.weavingTimer = weavingTimer;
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
this.maxAggregateTransactionsPerType = maxAggregateTransactionsPerType;
this.maxAggregateQueriesPerType = maxAggregateQueriesPerType;
this.maxAggregateServiceCallsPerType = maxAggregateServiceCallsPerType;
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
this.maxStackTraceSamplesPerTransaction = maxStackTraceSamplesPerTransaction;
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
initShim.weavingTimer(weavingTimer);
initShim.immediatePartialStoreThresholdSeconds(immediatePartialStoreThresholdSeconds);
initShim.maxAggregateTransactionsPerType(maxAggregateTransactionsPerType);
initShim.maxAggregateQueriesPerType(maxAggregateQueriesPerType);
initShim.maxAggregateServiceCallsPerType(maxAggregateServiceCallsPerType);
initShim.maxTraceEntriesPerTransaction(maxTraceEntriesPerTransaction);
initShim.maxStackTraceSamplesPerTransaction(maxStackTraceSamplesPerTransaction);
initShim.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 volatile InitShim initShim = new InitShim();
private final class InitShim {
private boolean weavingTimer;
private byte weavingTimerStage;
boolean weavingTimer() {
if (weavingTimerStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (weavingTimerStage == STAGE_UNINITIALIZED) {
weavingTimerStage = STAGE_INITIALIZING;
this.weavingTimer = ImmutableAdvancedConfig.super.weavingTimer();
weavingTimerStage = STAGE_INITIALIZED;
}
return weavingTimer;
}
boolean weavingTimer(boolean value) {
this.weavingTimer = value;
weavingTimerStage = STAGE_INITIALIZED;
return value;
}
private int immediatePartialStoreThresholdSeconds;
private byte immediatePartialStoreThresholdSecondsStage;
int immediatePartialStoreThresholdSeconds() {
if (immediatePartialStoreThresholdSecondsStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (immediatePartialStoreThresholdSecondsStage == STAGE_UNINITIALIZED) {
immediatePartialStoreThresholdSecondsStage = STAGE_INITIALIZING;
this.immediatePartialStoreThresholdSeconds = ImmutableAdvancedConfig.super.immediatePartialStoreThresholdSeconds();
immediatePartialStoreThresholdSecondsStage = STAGE_INITIALIZED;
}
return immediatePartialStoreThresholdSeconds;
}
int immediatePartialStoreThresholdSeconds(int value) {
this.immediatePartialStoreThresholdSeconds = value;
immediatePartialStoreThresholdSecondsStage = STAGE_INITIALIZED;
return value;
}
private int maxAggregateTransactionsPerType;
private byte maxAggregateTransactionsPerTypeStage;
int maxAggregateTransactionsPerType() {
if (maxAggregateTransactionsPerTypeStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxAggregateTransactionsPerTypeStage == STAGE_UNINITIALIZED) {
maxAggregateTransactionsPerTypeStage = STAGE_INITIALIZING;
this.maxAggregateTransactionsPerType = ImmutableAdvancedConfig.super.maxAggregateTransactionsPerType();
maxAggregateTransactionsPerTypeStage = STAGE_INITIALIZED;
}
return maxAggregateTransactionsPerType;
}
int maxAggregateTransactionsPerType(int value) {
this.maxAggregateTransactionsPerType = value;
maxAggregateTransactionsPerTypeStage = STAGE_INITIALIZED;
return value;
}
private int maxAggregateQueriesPerType;
private byte maxAggregateQueriesPerTypeStage;
int maxAggregateQueriesPerType() {
if (maxAggregateQueriesPerTypeStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxAggregateQueriesPerTypeStage == STAGE_UNINITIALIZED) {
maxAggregateQueriesPerTypeStage = STAGE_INITIALIZING;
this.maxAggregateQueriesPerType = ImmutableAdvancedConfig.super.maxAggregateQueriesPerType();
maxAggregateQueriesPerTypeStage = STAGE_INITIALIZED;
}
return maxAggregateQueriesPerType;
}
int maxAggregateQueriesPerType(int value) {
this.maxAggregateQueriesPerType = value;
maxAggregateQueriesPerTypeStage = STAGE_INITIALIZED;
return value;
}
private int maxAggregateServiceCallsPerType;
private byte maxAggregateServiceCallsPerTypeStage;
int maxAggregateServiceCallsPerType() {
if (maxAggregateServiceCallsPerTypeStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxAggregateServiceCallsPerTypeStage == STAGE_UNINITIALIZED) {
maxAggregateServiceCallsPerTypeStage = STAGE_INITIALIZING;
this.maxAggregateServiceCallsPerType = ImmutableAdvancedConfig.super.maxAggregateServiceCallsPerType();
maxAggregateServiceCallsPerTypeStage = STAGE_INITIALIZED;
}
return maxAggregateServiceCallsPerType;
}
int maxAggregateServiceCallsPerType(int value) {
this.maxAggregateServiceCallsPerType = value;
maxAggregateServiceCallsPerTypeStage = STAGE_INITIALIZED;
return value;
}
private int maxTraceEntriesPerTransaction;
private byte maxTraceEntriesPerTransactionStage;
int maxTraceEntriesPerTransaction() {
if (maxTraceEntriesPerTransactionStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxTraceEntriesPerTransactionStage == STAGE_UNINITIALIZED) {
maxTraceEntriesPerTransactionStage = STAGE_INITIALIZING;
this.maxTraceEntriesPerTransaction = ImmutableAdvancedConfig.super.maxTraceEntriesPerTransaction();
maxTraceEntriesPerTransactionStage = STAGE_INITIALIZED;
}
return maxTraceEntriesPerTransaction;
}
int maxTraceEntriesPerTransaction(int value) {
this.maxTraceEntriesPerTransaction = value;
maxTraceEntriesPerTransactionStage = STAGE_INITIALIZED;
return value;
}
private int maxStackTraceSamplesPerTransaction;
private byte maxStackTraceSamplesPerTransactionStage;
int maxStackTraceSamplesPerTransaction() {
if (maxStackTraceSamplesPerTransactionStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (maxStackTraceSamplesPerTransactionStage == STAGE_UNINITIALIZED) {
maxStackTraceSamplesPerTransactionStage = STAGE_INITIALIZING;
this.maxStackTraceSamplesPerTransaction = ImmutableAdvancedConfig.super.maxStackTraceSamplesPerTransaction();
maxStackTraceSamplesPerTransactionStage = STAGE_INITIALIZED;
}
return maxStackTraceSamplesPerTransaction;
}
int maxStackTraceSamplesPerTransaction(int value) {
this.maxStackTraceSamplesPerTransaction = value;
maxStackTraceSamplesPerTransactionStage = STAGE_INITIALIZED;
return value;
}
private int mbeanGaugeNotFoundDelaySeconds;
private byte mbeanGaugeNotFoundDelaySecondsStage;
int mbeanGaugeNotFoundDelaySeconds() {
if (mbeanGaugeNotFoundDelaySecondsStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage());
if (mbeanGaugeNotFoundDelaySecondsStage == STAGE_UNINITIALIZED) {
mbeanGaugeNotFoundDelaySecondsStage = STAGE_INITIALIZING;
this.mbeanGaugeNotFoundDelaySeconds = ImmutableAdvancedConfig.super.mbeanGaugeNotFoundDelaySeconds();
mbeanGaugeNotFoundDelaySecondsStage = STAGE_INITIALIZED;
}
return mbeanGaugeNotFoundDelaySeconds;
}
int mbeanGaugeNotFoundDelaySeconds(int value) {
this.mbeanGaugeNotFoundDelaySeconds = value;
mbeanGaugeNotFoundDelaySecondsStage = STAGE_INITIALIZED;
return value;
}
private String formatInitCycleMessage() {
ArrayList attributes = Lists.newArrayList();
if (weavingTimerStage == STAGE_INITIALIZING) attributes.add("weavingTimer");
if (immediatePartialStoreThresholdSecondsStage == STAGE_INITIALIZING) attributes.add("immediatePartialStoreThresholdSeconds");
if (maxAggregateTransactionsPerTypeStage == STAGE_INITIALIZING) attributes.add("maxAggregateTransactionsPerType");
if (maxAggregateQueriesPerTypeStage == STAGE_INITIALIZING) attributes.add("maxAggregateQueriesPerType");
if (maxAggregateServiceCallsPerTypeStage == STAGE_INITIALIZING) attributes.add("maxAggregateServiceCallsPerType");
if (maxTraceEntriesPerTransactionStage == STAGE_INITIALIZING) attributes.add("maxTraceEntriesPerTransaction");
if (maxStackTraceSamplesPerTransactionStage == STAGE_INITIALIZING) attributes.add("maxStackTraceSamplesPerTransaction");
if (mbeanGaugeNotFoundDelaySecondsStage == STAGE_INITIALIZING) attributes.add("mbeanGaugeNotFoundDelaySeconds");
return "Cannot build AdvancedConfig, attribute initializers form cycle" + attributes;
}
}
/**
* @return The value of the {@code weavingTimer} attribute
*/
@JsonProperty
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
@Override
public boolean weavingTimer() {
return initShim != null
? initShim.weavingTimer()
: weavingTimer;
}
/**
* @return The value of the {@code immediatePartialStoreThresholdSeconds} attribute
*/
@JsonProperty
@Override
public int immediatePartialStoreThresholdSeconds() {
return initShim != null
? initShim.immediatePartialStoreThresholdSeconds()
: immediatePartialStoreThresholdSeconds;
}
/**
* @return The value of the {@code maxAggregateTransactionsPerType} attribute
*/
@JsonProperty
@Override
public int maxAggregateTransactionsPerType() {
return initShim != null
? initShim.maxAggregateTransactionsPerType()
: maxAggregateTransactionsPerType;
}
/**
* @return The value of the {@code maxAggregateQueriesPerType} attribute
*/
@JsonProperty
@Override
public int maxAggregateQueriesPerType() {
return initShim != null
? initShim.maxAggregateQueriesPerType()
: maxAggregateQueriesPerType;
}
/**
* @return The value of the {@code maxAggregateServiceCallsPerType} attribute
*/
@JsonProperty
@Override
public int maxAggregateServiceCallsPerType() {
return initShim != null
? initShim.maxAggregateServiceCallsPerType()
: maxAggregateServiceCallsPerType;
}
/**
* @return The value of the {@code maxTraceEntriesPerTransaction} attribute
*/
@JsonProperty
@Override
public int maxTraceEntriesPerTransaction() {
return initShim != null
? initShim.maxTraceEntriesPerTransaction()
: maxTraceEntriesPerTransaction;
}
/**
* @return The value of the {@code maxStackTraceSamplesPerTransaction} attribute
*/
@JsonProperty
@Override
public int maxStackTraceSamplesPerTransaction() {
return initShim != null
? initShim.maxStackTraceSamplesPerTransaction()
: maxStackTraceSamplesPerTransaction;
}
/**
* @return The value of the {@code mbeanGaugeNotFoundDelaySeconds} attribute
*/
@JsonProperty
@Override
public int mbeanGaugeNotFoundDelaySeconds() {
return initShim != null
? initShim.mbeanGaugeNotFoundDelaySeconds()
: 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.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
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.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxAggregateTransactionsPerType() maxAggregateTransactionsPerType} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxAggregateTransactionsPerType
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxAggregateTransactionsPerType(int value) {
if (this.maxAggregateTransactionsPerType == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
value,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxAggregateQueriesPerType() maxAggregateQueriesPerType} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxAggregateQueriesPerType
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxAggregateQueriesPerType(int value) {
if (this.maxAggregateQueriesPerType == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxAggregateTransactionsPerType,
value,
this.maxAggregateServiceCallsPerType,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxAggregateServiceCallsPerType() maxAggregateServiceCallsPerType} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxAggregateServiceCallsPerType
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxAggregateServiceCallsPerType(int value) {
if (this.maxAggregateServiceCallsPerType == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
value,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
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.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
value,
this.maxStackTraceSamplesPerTransaction,
this.mbeanGaugeNotFoundDelaySeconds);
}
/**
* Copy the current immutable object by setting a value for the {@link AdvancedConfig#maxStackTraceSamplesPerTransaction() maxStackTraceSamplesPerTransaction} attribute.
* A value equality check is used to prevent copying of the same value by returning {@code this}.
* @param value A new value for maxStackTraceSamplesPerTransaction
* @return A modified copy of the {@code this} object
*/
public final ImmutableAdvancedConfig withMaxStackTraceSamplesPerTransaction(int value) {
if (this.maxStackTraceSamplesPerTransaction == value) return this;
return new ImmutableAdvancedConfig(
this.weavingTimer,
this.immediatePartialStoreThresholdSeconds,
this.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
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.maxAggregateTransactionsPerType,
this.maxAggregateQueriesPerType,
this.maxAggregateServiceCallsPerType,
this.maxTraceEntriesPerTransaction,
this.maxStackTraceSamplesPerTransaction,
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
&& maxAggregateTransactionsPerType == another.maxAggregateTransactionsPerType
&& maxAggregateQueriesPerType == another.maxAggregateQueriesPerType
&& maxAggregateServiceCallsPerType == another.maxAggregateServiceCallsPerType
&& maxTraceEntriesPerTransaction == another.maxTraceEntriesPerTransaction
&& maxStackTraceSamplesPerTransaction == another.maxStackTraceSamplesPerTransaction
&& mbeanGaugeNotFoundDelaySeconds == another.mbeanGaugeNotFoundDelaySeconds;
}
/**
* Computes a hash code from attributes: {@code weavingTimer}, {@code immediatePartialStoreThresholdSeconds}, {@code maxAggregateTransactionsPerType}, {@code maxAggregateQueriesPerType}, {@code maxAggregateServiceCallsPerType}, {@code maxTraceEntriesPerTransaction}, {@code maxStackTraceSamplesPerTransaction}, {@code mbeanGaugeNotFoundDelaySeconds}.
* @return hashCode value
*/
@Override
public int hashCode() {
int h = 31;
h = h * 17 + Booleans.hashCode(weavingTimer);
h = h * 17 + immediatePartialStoreThresholdSeconds;
h = h * 17 + maxAggregateTransactionsPerType;
h = h * 17 + maxAggregateQueriesPerType;
h = h * 17 + maxAggregateServiceCallsPerType;
h = h * 17 + maxTraceEntriesPerTransaction;
h = h * 17 + maxStackTraceSamplesPerTransaction;
h = h * 17 + mbeanGaugeNotFoundDelaySeconds;
return h;
}
/**
* Prints the immutable value {@code AdvancedConfig...} with all non-generated
* and non-auxiliary attribute values.
* @return A string representation of the value
*/
@Override
public String toString() {
return MoreObjects.toStringHelper("AdvancedConfig")
.add("weavingTimer", weavingTimer)
.add("immediatePartialStoreThresholdSeconds", immediatePartialStoreThresholdSeconds)
.add("maxAggregateTransactionsPerType", maxAggregateTransactionsPerType)
.add("maxAggregateQueriesPerType", maxAggregateQueriesPerType)
.add("maxAggregateServiceCallsPerType", maxAggregateServiceCallsPerType)
.add("maxTraceEntriesPerTransaction", maxTraceEntriesPerTransaction)
.add("maxStackTraceSamplesPerTransaction", maxStackTraceSamplesPerTransaction)
.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
static final class Json extends AdvancedConfig {
@Nullable Boolean weavingTimer;
@Nullable Integer immediatePartialStoreThresholdSeconds;
@Nullable Integer maxAggregateTransactionsPerType;
@Nullable Integer maxAggregateQueriesPerType;
@Nullable Integer maxAggregateServiceCallsPerType;
@Nullable Integer maxTraceEntriesPerTransaction;
@Nullable Integer maxStackTraceSamplesPerTransaction;
@Nullable Integer mbeanGaugeNotFoundDelaySeconds;
@JsonProperty
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
public void setWeavingTimer(boolean weavingTimer) {
this.weavingTimer = weavingTimer;
}
@JsonProperty
public void setImmediatePartialStoreThresholdSeconds(int immediatePartialStoreThresholdSeconds) {
this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds;
}
@JsonProperty
public void setMaxAggregateTransactionsPerType(int maxAggregateTransactionsPerType) {
this.maxAggregateTransactionsPerType = maxAggregateTransactionsPerType;
}
@JsonProperty
public void setMaxAggregateQueriesPerType(int maxAggregateQueriesPerType) {
this.maxAggregateQueriesPerType = maxAggregateQueriesPerType;
}
@JsonProperty
public void setMaxAggregateServiceCallsPerType(int maxAggregateServiceCallsPerType) {
this.maxAggregateServiceCallsPerType = maxAggregateServiceCallsPerType;
}
@JsonProperty
public void setMaxTraceEntriesPerTransaction(int maxTraceEntriesPerTransaction) {
this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction;
}
@JsonProperty
public void setMaxStackTraceSamplesPerTransaction(int maxStackTraceSamplesPerTransaction) {
this.maxStackTraceSamplesPerTransaction = maxStackTraceSamplesPerTransaction;
}
@JsonProperty
public void setMbeanGaugeNotFoundDelaySeconds(int mbeanGaugeNotFoundDelaySeconds) {
this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds;
}
@Override
public boolean weavingTimer() { throw new UnsupportedOperationException(); }
@Override
public int immediatePartialStoreThresholdSeconds() { throw new UnsupportedOperationException(); }
@Override
public int maxAggregateTransactionsPerType() { throw new UnsupportedOperationException(); }
@Override
public int maxAggregateQueriesPerType() { throw new UnsupportedOperationException(); }
@Override
public int maxAggregateServiceCallsPerType() { throw new UnsupportedOperationException(); }
@Override
public int maxTraceEntriesPerTransaction() { throw new UnsupportedOperationException(); }
@Override
public int maxStackTraceSamplesPerTransaction() { 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
static ImmutableAdvancedConfig fromJson(Json json) {
ImmutableAdvancedConfig.Builder builder = ImmutableAdvancedConfig.builder();
if (json.weavingTimer != null) {
builder.weavingTimer(json.weavingTimer);
}
if (json.immediatePartialStoreThresholdSeconds != null) {
builder.immediatePartialStoreThresholdSeconds(json.immediatePartialStoreThresholdSeconds);
}
if (json.maxAggregateTransactionsPerType != null) {
builder.maxAggregateTransactionsPerType(json.maxAggregateTransactionsPerType);
}
if (json.maxAggregateQueriesPerType != null) {
builder.maxAggregateQueriesPerType(json.maxAggregateQueriesPerType);
}
if (json.maxAggregateServiceCallsPerType != null) {
builder.maxAggregateServiceCallsPerType(json.maxAggregateServiceCallsPerType);
}
if (json.maxTraceEntriesPerTransaction != null) {
builder.maxTraceEntriesPerTransaction(json.maxTraceEntriesPerTransaction);
}
if (json.maxStackTraceSamplesPerTransaction != null) {
builder.maxStackTraceSamplesPerTransaction(json.maxStackTraceSamplesPerTransaction);
}
if (json.mbeanGaugeNotFoundDelaySeconds != null) {
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_AGGREGATE_TRANSACTIONS_PER_TYPE = 0x4L;
private static final long OPT_BIT_MAX_AGGREGATE_QUERIES_PER_TYPE = 0x8L;
private static final long OPT_BIT_MAX_AGGREGATE_SERVICE_CALLS_PER_TYPE = 0x10L;
private static final long OPT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION = 0x20L;
private static final long OPT_BIT_MAX_STACK_TRACE_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 maxAggregateTransactionsPerType;
private int maxAggregateQueriesPerType;
private int maxAggregateServiceCallsPerType;
private int maxTraceEntriesPerTransaction;
private int maxStackTraceSamplesPerTransaction;
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
*/
public final Builder copyFrom(AdvancedConfig instance) {
Preconditions.checkNotNull(instance, "instance");
weavingTimer(instance.weavingTimer());
immediatePartialStoreThresholdSeconds(instance.immediatePartialStoreThresholdSeconds());
maxAggregateTransactionsPerType(instance.maxAggregateTransactionsPerType());
maxAggregateQueriesPerType(instance.maxAggregateQueriesPerType());
maxAggregateServiceCallsPerType(instance.maxAggregateServiceCallsPerType());
maxTraceEntriesPerTransaction(instance.maxTraceEntriesPerTransaction());
maxStackTraceSamplesPerTransaction(instance.maxStackTraceSamplesPerTransaction());
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
*/
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
*/
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#maxAggregateTransactionsPerType() maxAggregateTransactionsPerType} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxAggregateTransactionsPerType() maxAggregateTransactionsPerType}.
* @param maxAggregateTransactionsPerType The value for maxAggregateTransactionsPerType
* @return {@code this} builder for use in a chained invocation
*/
public final Builder maxAggregateTransactionsPerType(int maxAggregateTransactionsPerType) {
this.maxAggregateTransactionsPerType = maxAggregateTransactionsPerType;
optBits |= OPT_BIT_MAX_AGGREGATE_TRANSACTIONS_PER_TYPE;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxAggregateQueriesPerType() maxAggregateQueriesPerType} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxAggregateQueriesPerType() maxAggregateQueriesPerType}.
* @param maxAggregateQueriesPerType The value for maxAggregateQueriesPerType
* @return {@code this} builder for use in a chained invocation
*/
public final Builder maxAggregateQueriesPerType(int maxAggregateQueriesPerType) {
this.maxAggregateQueriesPerType = maxAggregateQueriesPerType;
optBits |= OPT_BIT_MAX_AGGREGATE_QUERIES_PER_TYPE;
return this;
}
/**
* Initializes the value for the {@link AdvancedConfig#maxAggregateServiceCallsPerType() maxAggregateServiceCallsPerType} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxAggregateServiceCallsPerType() maxAggregateServiceCallsPerType}.
* @param maxAggregateServiceCallsPerType The value for maxAggregateServiceCallsPerType
* @return {@code this} builder for use in a chained invocation
*/
public final Builder maxAggregateServiceCallsPerType(int maxAggregateServiceCallsPerType) {
this.maxAggregateServiceCallsPerType = maxAggregateServiceCallsPerType;
optBits |= OPT_BIT_MAX_AGGREGATE_SERVICE_CALLS_PER_TYPE;
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
*/
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#maxStackTraceSamplesPerTransaction() maxStackTraceSamplesPerTransaction} attribute.
*
If not set, this attribute will have a default value as returned by the initializer of {@link AdvancedConfig#maxStackTraceSamplesPerTransaction() maxStackTraceSamplesPerTransaction}.
* @param maxStackTraceSamplesPerTransaction The value for maxStackTraceSamplesPerTransaction
* @return {@code this} builder for use in a chained invocation
*/
public final Builder maxStackTraceSamplesPerTransaction(int maxStackTraceSamplesPerTransaction) {
this.maxStackTraceSamplesPerTransaction = maxStackTraceSamplesPerTransaction;
optBits |= OPT_BIT_MAX_STACK_TRACE_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
*/
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 maxAggregateTransactionsPerTypeIsSet() {
return (optBits & OPT_BIT_MAX_AGGREGATE_TRANSACTIONS_PER_TYPE) != 0;
}
private boolean maxAggregateQueriesPerTypeIsSet() {
return (optBits & OPT_BIT_MAX_AGGREGATE_QUERIES_PER_TYPE) != 0;
}
private boolean maxAggregateServiceCallsPerTypeIsSet() {
return (optBits & OPT_BIT_MAX_AGGREGATE_SERVICE_CALLS_PER_TYPE) != 0;
}
private boolean maxTraceEntriesPerTransactionIsSet() {
return (optBits & OPT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION) != 0;
}
private boolean maxStackTraceSamplesPerTransactionIsSet() {
return (optBits & OPT_BIT_MAX_STACK_TRACE_SAMPLES_PER_TRANSACTION) != 0;
}
private boolean mbeanGaugeNotFoundDelaySecondsIsSet() {
return (optBits & OPT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS) != 0;
}
}
}