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

org.glowroot.ui.ImmutableAdvancedConfigDto Maven / Gradle / Ivy

There is a newer version: 0.9.28
Show newest version
package org.glowroot.ui;

import org.glowroot.agent.shaded.fasterxml.jackson.annotation.JsonCreator;
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.List;
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 ConfigJsonService.AdvancedConfigDto}.
 * 

* Use builder to create immutable instances: * {@code ImmutableAdvancedConfigDto.builder()}. */ @SuppressWarnings("all") @ParametersAreNonnullByDefault @Generated({"Immutables.generator", "ConfigJsonService.AdvancedConfigDto"}) @Immutable final class ImmutableAdvancedConfigDto extends ConfigJsonService.AdvancedConfigDto { private final boolean timerWrapperMethods; private final boolean weavingTimer; private final int immediatePartialStoreThresholdSeconds; private final int maxAggregateTransactionsPerTransactionType; private final int maxAggregateQueriesPerQueryType; private final int maxTraceEntriesPerTransaction; private final int maxStackTraceSamplesPerTransaction; private final boolean captureThreadInfo; private final boolean captureGcActivity; private final int mbeanGaugeNotFoundDelaySeconds; private final String version; private ImmutableAdvancedConfigDto( boolean timerWrapperMethods, boolean weavingTimer, int immediatePartialStoreThresholdSeconds, int maxAggregateTransactionsPerTransactionType, int maxAggregateQueriesPerQueryType, int maxTraceEntriesPerTransaction, int maxStackTraceSamplesPerTransaction, boolean captureThreadInfo, boolean captureGcActivity, int mbeanGaugeNotFoundDelaySeconds, String version) { this.timerWrapperMethods = timerWrapperMethods; this.weavingTimer = weavingTimer; this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds; this.maxAggregateTransactionsPerTransactionType = maxAggregateTransactionsPerTransactionType; this.maxAggregateQueriesPerQueryType = maxAggregateQueriesPerQueryType; this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction; this.maxStackTraceSamplesPerTransaction = maxStackTraceSamplesPerTransaction; this.captureThreadInfo = captureThreadInfo; this.captureGcActivity = captureGcActivity; this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds; this.version = version; } /** * @return value of {@code timerWrapperMethods} attribute */ @JsonProperty @Override boolean timerWrapperMethods() { return timerWrapperMethods; } /** * @return value of {@code weavingTimer} attribute */ @JsonProperty @Override boolean weavingTimer() { return weavingTimer; } /** * @return value of {@code immediatePartialStoreThresholdSeconds} attribute */ @JsonProperty @Override int immediatePartialStoreThresholdSeconds() { return immediatePartialStoreThresholdSeconds; } /** * @return value of {@code maxAggregateTransactionsPerTransactionType} attribute */ @JsonProperty @Override int maxAggregateTransactionsPerTransactionType() { return maxAggregateTransactionsPerTransactionType; } /** * @return value of {@code maxAggregateQueriesPerQueryType} attribute */ @JsonProperty @Override int maxAggregateQueriesPerQueryType() { return maxAggregateQueriesPerQueryType; } /** * @return value of {@code maxTraceEntriesPerTransaction} attribute */ @JsonProperty @Override int maxTraceEntriesPerTransaction() { return maxTraceEntriesPerTransaction; } /** * @return value of {@code maxStackTraceSamplesPerTransaction} attribute */ @JsonProperty @Override int maxStackTraceSamplesPerTransaction() { return maxStackTraceSamplesPerTransaction; } /** * @return value of {@code captureThreadInfo} attribute */ @JsonProperty @Override boolean captureThreadInfo() { return captureThreadInfo; } /** * @return value of {@code captureGcActivity} attribute */ @JsonProperty @Override boolean captureGcActivity() { return captureGcActivity; } /** * @return value of {@code mbeanGaugeNotFoundDelaySeconds} attribute */ @JsonProperty @Override int mbeanGaugeNotFoundDelaySeconds() { return mbeanGaugeNotFoundDelaySeconds; } /** * @return value of {@code version} attribute */ @JsonProperty @Override String version() { return version; } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#timerWrapperMethods() timerWrapperMethods}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for timerWrapperMethods * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withTimerWrapperMethods(boolean value) { if (this.timerWrapperMethods == value) return this; boolean newValue = value; return new ImmutableAdvancedConfigDto( newValue, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#weavingTimer() weavingTimer}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for weavingTimer * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withWeavingTimer(boolean value) { if (this.weavingTimer == value) return this; boolean newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, newValue, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#immediatePartialStoreThresholdSeconds() immediatePartialStoreThresholdSeconds}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for immediatePartialStoreThresholdSeconds * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withImmediatePartialStoreThresholdSeconds(int value) { if (this.immediatePartialStoreThresholdSeconds == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, newValue, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#maxAggregateTransactionsPerTransactionType() maxAggregateTransactionsPerTransactionType}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for maxAggregateTransactionsPerTransactionType * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withMaxAggregateTransactionsPerTransactionType(int value) { if (this.maxAggregateTransactionsPerTransactionType == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, newValue, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#maxAggregateQueriesPerQueryType() maxAggregateQueriesPerQueryType}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for maxAggregateQueriesPerQueryType * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withMaxAggregateQueriesPerQueryType(int value) { if (this.maxAggregateQueriesPerQueryType == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, newValue, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#maxTraceEntriesPerTransaction() maxTraceEntriesPerTransaction}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for maxTraceEntriesPerTransaction * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withMaxTraceEntriesPerTransaction(int value) { if (this.maxTraceEntriesPerTransaction == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, newValue, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#maxStackTraceSamplesPerTransaction() maxStackTraceSamplesPerTransaction}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for maxStackTraceSamplesPerTransaction * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withMaxStackTraceSamplesPerTransaction(int value) { if (this.maxStackTraceSamplesPerTransaction == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, newValue, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#captureThreadInfo() captureThreadInfo}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for captureThreadInfo * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withCaptureThreadInfo(boolean value) { if (this.captureThreadInfo == value) return this; boolean newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, newValue, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#captureGcActivity() captureGcActivity}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for captureGcActivity * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withCaptureGcActivity(boolean value) { if (this.captureGcActivity == value) return this; boolean newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, newValue, this.mbeanGaugeNotFoundDelaySeconds, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#mbeanGaugeNotFoundDelaySeconds() mbeanGaugeNotFoundDelaySeconds}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for mbeanGaugeNotFoundDelaySeconds * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withMbeanGaugeNotFoundDelaySeconds(int value) { if (this.mbeanGaugeNotFoundDelaySeconds == value) return this; int newValue = value; return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, newValue, this.version); } /** * Copy current immutable object by setting value for {@link ConfigJsonService.AdvancedConfigDto#version() version}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for version * @return modified copy of the {@code this} object */ public final ImmutableAdvancedConfigDto withVersion(String value) { if (this.version == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableAdvancedConfigDto( this.timerWrapperMethods, this.weavingTimer, this.immediatePartialStoreThresholdSeconds, this.maxAggregateTransactionsPerTransactionType, this.maxAggregateQueriesPerQueryType, this.maxTraceEntriesPerTransaction, this.maxStackTraceSamplesPerTransaction, this.captureThreadInfo, this.captureGcActivity, this.mbeanGaugeNotFoundDelaySeconds, newValue); } /** * This instance is equal to instances of {@code ImmutableAdvancedConfigDto} with 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 ImmutableAdvancedConfigDto && equalTo((ImmutableAdvancedConfigDto) another); } private boolean equalTo(ImmutableAdvancedConfigDto another) { return timerWrapperMethods == another.timerWrapperMethods && weavingTimer == another.weavingTimer && immediatePartialStoreThresholdSeconds == another.immediatePartialStoreThresholdSeconds && maxAggregateTransactionsPerTransactionType == another.maxAggregateTransactionsPerTransactionType && maxAggregateQueriesPerQueryType == another.maxAggregateQueriesPerQueryType && maxTraceEntriesPerTransaction == another.maxTraceEntriesPerTransaction && maxStackTraceSamplesPerTransaction == another.maxStackTraceSamplesPerTransaction && captureThreadInfo == another.captureThreadInfo && captureGcActivity == another.captureGcActivity && mbeanGaugeNotFoundDelaySeconds == another.mbeanGaugeNotFoundDelaySeconds && version.equals(another.version); } /** * Computes hash code from attributes: {@code timerWrapperMethods}, {@code weavingTimer}, {@code immediatePartialStoreThresholdSeconds}, {@code maxAggregateTransactionsPerTransactionType}, {@code maxAggregateQueriesPerQueryType}, {@code maxTraceEntriesPerTransaction}, {@code maxStackTraceSamplesPerTransaction}, {@code captureThreadInfo}, {@code captureGcActivity}, {@code mbeanGaugeNotFoundDelaySeconds}, {@code version}. * @return hashCode value */ @Override public int hashCode() { int h = 31; h = h * 17 + Booleans.hashCode(timerWrapperMethods); h = h * 17 + Booleans.hashCode(weavingTimer); h = h * 17 + immediatePartialStoreThresholdSeconds; h = h * 17 + maxAggregateTransactionsPerTransactionType; h = h * 17 + maxAggregateQueriesPerQueryType; h = h * 17 + maxTraceEntriesPerTransaction; h = h * 17 + maxStackTraceSamplesPerTransaction; h = h * 17 + Booleans.hashCode(captureThreadInfo); h = h * 17 + Booleans.hashCode(captureGcActivity); h = h * 17 + mbeanGaugeNotFoundDelaySeconds; h = h * 17 + version.hashCode(); return h; } /** * Prints immutable value {@code AdvancedConfigDto...} with attribute values, * excluding any non-generated and auxiliary attributes. * @return string representation of value */ @Override public String toString() { return MoreObjects.toStringHelper("AdvancedConfigDto") .add("timerWrapperMethods", timerWrapperMethods) .add("weavingTimer", weavingTimer) .add("immediatePartialStoreThresholdSeconds", immediatePartialStoreThresholdSeconds) .add("maxAggregateTransactionsPerTransactionType", maxAggregateTransactionsPerTransactionType) .add("maxAggregateQueriesPerQueryType", maxAggregateQueriesPerQueryType) .add("maxTraceEntriesPerTransaction", maxTraceEntriesPerTransaction) .add("maxStackTraceSamplesPerTransaction", maxStackTraceSamplesPerTransaction) .add("captureThreadInfo", captureThreadInfo) .add("captureGcActivity", captureGcActivity) .add("mbeanGaugeNotFoundDelaySeconds", mbeanGaugeNotFoundDelaySeconds) .add("version", version) .toString(); } /** * Simple representation of this value type suitable Jackson binding * @deprecated Do not use this type directly, it exists only for Jackson-binding infrastructure */ @Deprecated static final class Json { @JsonProperty @Nullable Boolean timerWrapperMethods; @JsonProperty @Nullable Boolean weavingTimer; @JsonProperty @Nullable Integer immediatePartialStoreThresholdSeconds; @JsonProperty @Nullable Integer maxAggregateTransactionsPerTransactionType; @JsonProperty @Nullable Integer maxAggregateQueriesPerQueryType; @JsonProperty @Nullable Integer maxTraceEntriesPerTransaction; @JsonProperty @Nullable Integer maxStackTraceSamplesPerTransaction; @JsonProperty @Nullable Boolean captureThreadInfo; @JsonProperty @Nullable Boolean captureGcActivity; @JsonProperty @Nullable Integer mbeanGaugeNotFoundDelaySeconds; @JsonProperty @Nullable String version; } /** * @param json JSON-bindable data structure * @return immutable value type * @deprecated Do not use this method directly, it exists only for Jackson-binding infrastructure */ @Deprecated @JsonCreator static ImmutableAdvancedConfigDto fromJson(Json json) { ImmutableAdvancedConfigDto.Builder builder = ImmutableAdvancedConfigDto.builder(); if (json.timerWrapperMethods != null) { builder.timerWrapperMethods(json.timerWrapperMethods); } if (json.weavingTimer != null) { builder.weavingTimer(json.weavingTimer); } if (json.immediatePartialStoreThresholdSeconds != null) { builder.immediatePartialStoreThresholdSeconds(json.immediatePartialStoreThresholdSeconds); } if (json.maxAggregateTransactionsPerTransactionType != null) { builder.maxAggregateTransactionsPerTransactionType(json.maxAggregateTransactionsPerTransactionType); } if (json.maxAggregateQueriesPerQueryType != null) { builder.maxAggregateQueriesPerQueryType(json.maxAggregateQueriesPerQueryType); } if (json.maxTraceEntriesPerTransaction != null) { builder.maxTraceEntriesPerTransaction(json.maxTraceEntriesPerTransaction); } if (json.maxStackTraceSamplesPerTransaction != null) { builder.maxStackTraceSamplesPerTransaction(json.maxStackTraceSamplesPerTransaction); } if (json.captureThreadInfo != null) { builder.captureThreadInfo(json.captureThreadInfo); } if (json.captureGcActivity != null) { builder.captureGcActivity(json.captureGcActivity); } if (json.mbeanGaugeNotFoundDelaySeconds != null) { builder.mbeanGaugeNotFoundDelaySeconds(json.mbeanGaugeNotFoundDelaySeconds); } if (json.version != null) { builder.version(json.version); } return builder.build(); } /** * Creates immutable copy of {@link ConfigJsonService.AdvancedConfigDto}. * Uses accessors to get values to initialize immutable instance. * If an instance is already immutable, it is returned as is. * @param instance instance to copy * @return copied immutable AdvancedConfigDto instance */ static ImmutableAdvancedConfigDto copyOf(ConfigJsonService.AdvancedConfigDto instance) { if (instance instanceof ImmutableAdvancedConfigDto) { return (ImmutableAdvancedConfigDto) instance; } return ImmutableAdvancedConfigDto.builder() .copyFrom(instance) .build(); } /** * Creates builder for {@link org.glowroot.ui.ImmutableAdvancedConfigDto ImmutableAdvancedConfigDto}. * @return new ImmutableAdvancedConfigDto builder */ static ImmutableAdvancedConfigDto.Builder builder() { return new ImmutableAdvancedConfigDto.Builder(); } /** * Builds instances of {@link org.glowroot.ui.ImmutableAdvancedConfigDto ImmutableAdvancedConfigDto}. * Initialize attributes and then invoke {@link #build()} method to create * immutable instance. *

{@code Builder} is not thread safe and generally should not be stored in field or collection, * but used immediately to create instances. */ @NotThreadSafe static final class Builder { private static final long INIT_BIT_TIMER_WRAPPER_METHODS = 0x1L; private static final long INIT_BIT_WEAVING_TIMER = 0x2L; private static final long INIT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS = 0x4L; private static final long INIT_BIT_MAX_AGGREGATE_TRANSACTIONS_PER_TRANSACTION_TYPE = 0x8L; private static final long INIT_BIT_MAX_AGGREGATE_QUERIES_PER_QUERY_TYPE = 0x10L; private static final long INIT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION = 0x20L; private static final long INIT_BIT_MAX_STACK_TRACE_SAMPLES_PER_TRANSACTION = 0x40L; private static final long INIT_BIT_CAPTURE_THREAD_INFO = 0x80L; private static final long INIT_BIT_CAPTURE_GC_ACTIVITY = 0x100L; private static final long INIT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS = 0x200L; private static final long INIT_BIT_VERSION = 0x400L; private long initBits = 0x7ff; private boolean timerWrapperMethods; private boolean weavingTimer; private int immediatePartialStoreThresholdSeconds; private int maxAggregateTransactionsPerTransactionType; private int maxAggregateQueriesPerQueryType; private int maxTraceEntriesPerTransaction; private int maxStackTraceSamplesPerTransaction; private boolean captureThreadInfo; private boolean captureGcActivity; private int mbeanGaugeNotFoundDelaySeconds; private @Nullable String version; private Builder() {} /** * Fill builder with attribute values from provided {@link ConfigJsonService.AdvancedConfigDto} instance. * Regular attribute values will be replaced with ones of an instance. * Instance's absent optional values will not replace present values. * @param instance instance to copy values from * @return {@code this} builder for chained invocation */ public final Builder copyFrom(ConfigJsonService.AdvancedConfigDto instance) { Preconditions.checkNotNull(instance); timerWrapperMethods(instance.timerWrapperMethods()); weavingTimer(instance.weavingTimer()); immediatePartialStoreThresholdSeconds(instance.immediatePartialStoreThresholdSeconds()); maxAggregateTransactionsPerTransactionType(instance.maxAggregateTransactionsPerTransactionType()); maxAggregateQueriesPerQueryType(instance.maxAggregateQueriesPerQueryType()); maxTraceEntriesPerTransaction(instance.maxTraceEntriesPerTransaction()); maxStackTraceSamplesPerTransaction(instance.maxStackTraceSamplesPerTransaction()); captureThreadInfo(instance.captureThreadInfo()); captureGcActivity(instance.captureGcActivity()); mbeanGaugeNotFoundDelaySeconds(instance.mbeanGaugeNotFoundDelaySeconds()); version(instance.version()); return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#timerWrapperMethods() timerWrapperMethods}. * @param timerWrapperMethods value for timerWrapperMethods * @return {@code this} builder for chained invocation */ public final Builder timerWrapperMethods(boolean timerWrapperMethods) { this.timerWrapperMethods = timerWrapperMethods; initBits &= ~INIT_BIT_TIMER_WRAPPER_METHODS; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#weavingTimer() weavingTimer}. * @param weavingTimer value for weavingTimer * @return {@code this} builder for chained invocation */ public final Builder weavingTimer(boolean weavingTimer) { this.weavingTimer = weavingTimer; initBits &= ~INIT_BIT_WEAVING_TIMER; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#immediatePartialStoreThresholdSeconds() immediatePartialStoreThresholdSeconds}. * @param immediatePartialStoreThresholdSeconds value for immediatePartialStoreThresholdSeconds * @return {@code this} builder for chained invocation */ public final Builder immediatePartialStoreThresholdSeconds(int immediatePartialStoreThresholdSeconds) { this.immediatePartialStoreThresholdSeconds = immediatePartialStoreThresholdSeconds; initBits &= ~INIT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#maxAggregateTransactionsPerTransactionType() maxAggregateTransactionsPerTransactionType}. * @param maxAggregateTransactionsPerTransactionType value for maxAggregateTransactionsPerTransactionType * @return {@code this} builder for chained invocation */ public final Builder maxAggregateTransactionsPerTransactionType(int maxAggregateTransactionsPerTransactionType) { this.maxAggregateTransactionsPerTransactionType = maxAggregateTransactionsPerTransactionType; initBits &= ~INIT_BIT_MAX_AGGREGATE_TRANSACTIONS_PER_TRANSACTION_TYPE; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#maxAggregateQueriesPerQueryType() maxAggregateQueriesPerQueryType}. * @param maxAggregateQueriesPerQueryType value for maxAggregateQueriesPerQueryType * @return {@code this} builder for chained invocation */ public final Builder maxAggregateQueriesPerQueryType(int maxAggregateQueriesPerQueryType) { this.maxAggregateQueriesPerQueryType = maxAggregateQueriesPerQueryType; initBits &= ~INIT_BIT_MAX_AGGREGATE_QUERIES_PER_QUERY_TYPE; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#maxTraceEntriesPerTransaction() maxTraceEntriesPerTransaction}. * @param maxTraceEntriesPerTransaction value for maxTraceEntriesPerTransaction * @return {@code this} builder for chained invocation */ public final Builder maxTraceEntriesPerTransaction(int maxTraceEntriesPerTransaction) { this.maxTraceEntriesPerTransaction = maxTraceEntriesPerTransaction; initBits &= ~INIT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#maxStackTraceSamplesPerTransaction() maxStackTraceSamplesPerTransaction}. * @param maxStackTraceSamplesPerTransaction value for maxStackTraceSamplesPerTransaction * @return {@code this} builder for chained invocation */ public final Builder maxStackTraceSamplesPerTransaction(int maxStackTraceSamplesPerTransaction) { this.maxStackTraceSamplesPerTransaction = maxStackTraceSamplesPerTransaction; initBits &= ~INIT_BIT_MAX_STACK_TRACE_SAMPLES_PER_TRANSACTION; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#captureThreadInfo() captureThreadInfo}. * @param captureThreadInfo value for captureThreadInfo * @return {@code this} builder for chained invocation */ public final Builder captureThreadInfo(boolean captureThreadInfo) { this.captureThreadInfo = captureThreadInfo; initBits &= ~INIT_BIT_CAPTURE_THREAD_INFO; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#captureGcActivity() captureGcActivity}. * @param captureGcActivity value for captureGcActivity * @return {@code this} builder for chained invocation */ public final Builder captureGcActivity(boolean captureGcActivity) { this.captureGcActivity = captureGcActivity; initBits &= ~INIT_BIT_CAPTURE_GC_ACTIVITY; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#mbeanGaugeNotFoundDelaySeconds() mbeanGaugeNotFoundDelaySeconds}. * @param mbeanGaugeNotFoundDelaySeconds value for mbeanGaugeNotFoundDelaySeconds * @return {@code this} builder for chained invocation */ public final Builder mbeanGaugeNotFoundDelaySeconds(int mbeanGaugeNotFoundDelaySeconds) { this.mbeanGaugeNotFoundDelaySeconds = mbeanGaugeNotFoundDelaySeconds; initBits &= ~INIT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS; return this; } /** * Initializes value for {@link ConfigJsonService.AdvancedConfigDto#version() version}. * @param version value for version * @return {@code this} builder for chained invocation */ public final Builder version(String version) { this.version = Preconditions.checkNotNull(version); initBits &= ~INIT_BIT_VERSION; return this; } /** * Builds new {@link org.glowroot.ui.ImmutableAdvancedConfigDto ImmutableAdvancedConfigDto}. * @return immutable instance of AdvancedConfigDto * @throws exception {@code java.lang.IllegalStateException} if any required attributes are missing */ public ImmutableAdvancedConfigDto build() throws IllegalStateException { checkRequiredAttributes(); return new ImmutableAdvancedConfigDto( timerWrapperMethods, weavingTimer, immediatePartialStoreThresholdSeconds, maxAggregateTransactionsPerTransactionType, maxAggregateQueriesPerQueryType, maxTraceEntriesPerTransaction, maxStackTraceSamplesPerTransaction, captureThreadInfo, captureGcActivity, mbeanGaugeNotFoundDelaySeconds, version); } private boolean timerWrapperMethodsIsSet() { return (initBits & INIT_BIT_TIMER_WRAPPER_METHODS) == 0; } private boolean weavingTimerIsSet() { return (initBits & INIT_BIT_WEAVING_TIMER) == 0; } private boolean immediatePartialStoreThresholdSecondsIsSet() { return (initBits & INIT_BIT_IMMEDIATE_PARTIAL_STORE_THRESHOLD_SECONDS) == 0; } private boolean maxAggregateTransactionsPerTransactionTypeIsSet() { return (initBits & INIT_BIT_MAX_AGGREGATE_TRANSACTIONS_PER_TRANSACTION_TYPE) == 0; } private boolean maxAggregateQueriesPerQueryTypeIsSet() { return (initBits & INIT_BIT_MAX_AGGREGATE_QUERIES_PER_QUERY_TYPE) == 0; } private boolean maxTraceEntriesPerTransactionIsSet() { return (initBits & INIT_BIT_MAX_TRACE_ENTRIES_PER_TRANSACTION) == 0; } private boolean maxStackTraceSamplesPerTransactionIsSet() { return (initBits & INIT_BIT_MAX_STACK_TRACE_SAMPLES_PER_TRANSACTION) == 0; } private boolean captureThreadInfoIsSet() { return (initBits & INIT_BIT_CAPTURE_THREAD_INFO) == 0; } private boolean captureGcActivityIsSet() { return (initBits & INIT_BIT_CAPTURE_GC_ACTIVITY) == 0; } private boolean mbeanGaugeNotFoundDelaySecondsIsSet() { return (initBits & INIT_BIT_MBEAN_GAUGE_NOT_FOUND_DELAY_SECONDS) == 0; } private boolean versionIsSet() { return (initBits & INIT_BIT_VERSION) == 0; } private void checkRequiredAttributes() throws IllegalStateException { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } } private String formatRequiredAttributesMessage() { List attributes = Lists.newArrayList(); if (!timerWrapperMethodsIsSet()) attributes.add("timerWrapperMethods"); if (!weavingTimerIsSet()) attributes.add("weavingTimer"); if (!immediatePartialStoreThresholdSecondsIsSet()) attributes.add("immediatePartialStoreThresholdSeconds"); if (!maxAggregateTransactionsPerTransactionTypeIsSet()) attributes.add("maxAggregateTransactionsPerTransactionType"); if (!maxAggregateQueriesPerQueryTypeIsSet()) attributes.add("maxAggregateQueriesPerQueryType"); if (!maxTraceEntriesPerTransactionIsSet()) attributes.add("maxTraceEntriesPerTransaction"); if (!maxStackTraceSamplesPerTransactionIsSet()) attributes.add("maxStackTraceSamplesPerTransaction"); if (!captureThreadInfoIsSet()) attributes.add("captureThreadInfo"); if (!captureGcActivityIsSet()) attributes.add("captureGcActivity"); if (!mbeanGaugeNotFoundDelaySecondsIsSet()) attributes.add("mbeanGaugeNotFoundDelaySeconds"); if (!versionIsSet()) attributes.add("version"); return "Cannot build AdvancedConfigDto, some of required attributes are not set " + attributes; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy