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

org.glowroot.ui.ImmutableInstrumentationConfigDto 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.Objects;
import org.glowroot.agent.shaded.google.common.base.Preconditions;
import org.glowroot.agent.shaded.google.common.collect.ImmutableList;
import org.glowroot.agent.shaded.google.common.collect.ImmutableMap;
import org.glowroot.agent.shaded.google.common.collect.Lists;
import org.glowroot.agent.shaded.google.common.primitives.Booleans;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.NotThreadSafe;
import org.glowroot.common.config.InstrumentationConfig;

/**
 * Immutable implementation of {@link InstrumentationConfigJsonService.InstrumentationConfigDto}.
 * 

* Use builder to create immutable instances: * {@code ImmutableInstrumentationConfigDto.builder()}. */ @SuppressWarnings("all") @ParametersAreNonnullByDefault @Generated({"Immutables.generator", "InstrumentationConfigJsonService.InstrumentationConfigDto"}) @Immutable final class ImmutableInstrumentationConfigDto extends InstrumentationConfigJsonService.InstrumentationConfigDto { private final String className; private final String declaringClassName; private final String methodName; private final ImmutableList methodParameterTypes; private final String methodReturnType; private final ImmutableList methodModifiers; private final InstrumentationConfig.CaptureKind captureKind; private final String timerName; private final String traceEntryMessageTemplate; private final @Nullable Integer traceEntryStackThresholdMillis; private final boolean traceEntryCaptureSelfNested; private final String transactionType; private final String transactionNameTemplate; private final String transactionUserTemplate; private final ImmutableMap transactionAttributeTemplates; private final @Nullable Integer transactionSlowThresholdMillis; private final String enabledProperty; private final String traceEntryEnabledProperty; private final @Nullable String version; private ImmutableInstrumentationConfigDto( String className, String declaringClassName, String methodName, ImmutableList methodParameterTypes, String methodReturnType, ImmutableList methodModifiers, InstrumentationConfig.CaptureKind captureKind, String timerName, String traceEntryMessageTemplate, @Nullable Integer traceEntryStackThresholdMillis, boolean traceEntryCaptureSelfNested, String transactionType, String transactionNameTemplate, String transactionUserTemplate, ImmutableMap transactionAttributeTemplates, @Nullable Integer transactionSlowThresholdMillis, String enabledProperty, String traceEntryEnabledProperty, @Nullable String version) { this.className = className; this.declaringClassName = declaringClassName; this.methodName = methodName; this.methodParameterTypes = methodParameterTypes; this.methodReturnType = methodReturnType; this.methodModifiers = methodModifiers; this.captureKind = captureKind; this.timerName = timerName; this.traceEntryMessageTemplate = traceEntryMessageTemplate; this.traceEntryStackThresholdMillis = traceEntryStackThresholdMillis; this.traceEntryCaptureSelfNested = traceEntryCaptureSelfNested; this.transactionType = transactionType; this.transactionNameTemplate = transactionNameTemplate; this.transactionUserTemplate = transactionUserTemplate; this.transactionAttributeTemplates = transactionAttributeTemplates; this.transactionSlowThresholdMillis = transactionSlowThresholdMillis; this.enabledProperty = enabledProperty; this.traceEntryEnabledProperty = traceEntryEnabledProperty; this.version = version; } /** * @return value of {@code className} attribute */ @JsonProperty @Override String className() { return className; } /** * @return value of {@code declaringClassName} attribute */ @JsonProperty @Override String declaringClassName() { return declaringClassName; } /** * @return value of {@code methodName} attribute */ @JsonProperty @Override String methodName() { return methodName; } /** * @return value of {@code methodParameterTypes} attribute */ @JsonProperty @Override ImmutableList methodParameterTypes() { return methodParameterTypes; } /** * @return value of {@code methodReturnType} attribute */ @JsonProperty @Override String methodReturnType() { return methodReturnType; } /** * @return value of {@code methodModifiers} attribute */ @JsonProperty @Override ImmutableList methodModifiers() { return methodModifiers; } /** * @return value of {@code captureKind} attribute */ @JsonProperty @Override InstrumentationConfig.CaptureKind captureKind() { return captureKind; } /** * @return value of {@code timerName} attribute */ @JsonProperty @Override String timerName() { return timerName; } /** * @return value of {@code traceEntryMessageTemplate} attribute */ @JsonProperty @Override String traceEntryMessageTemplate() { return traceEntryMessageTemplate; } /** * @return value of {@code traceEntryStackThresholdMillis} attribute */ @JsonProperty @Override @Nullable Integer traceEntryStackThresholdMillis() { return traceEntryStackThresholdMillis; } /** * @return value of {@code traceEntryCaptureSelfNested} attribute */ @JsonProperty @Override boolean traceEntryCaptureSelfNested() { return traceEntryCaptureSelfNested; } /** * @return value of {@code transactionType} attribute */ @JsonProperty @Override String transactionType() { return transactionType; } /** * @return value of {@code transactionNameTemplate} attribute */ @JsonProperty @Override String transactionNameTemplate() { return transactionNameTemplate; } /** * @return value of {@code transactionUserTemplate} attribute */ @JsonProperty @Override String transactionUserTemplate() { return transactionUserTemplate; } /** * @return value of {@code transactionAttributeTemplates} attribute */ @JsonProperty @Override ImmutableMap transactionAttributeTemplates() { return transactionAttributeTemplates; } /** * @return value of {@code transactionSlowThresholdMillis} attribute */ @JsonProperty @Override @Nullable Integer transactionSlowThresholdMillis() { return transactionSlowThresholdMillis; } /** * @return value of {@code enabledProperty} attribute */ @JsonProperty @Override String enabledProperty() { return enabledProperty; } /** * @return value of {@code traceEntryEnabledProperty} attribute */ @JsonProperty @Override String traceEntryEnabledProperty() { return traceEntryEnabledProperty; } /** * @return value of {@code version} attribute */ @JsonProperty @Override @Nullable String version() { return version; } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#className() className}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for className * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withClassName(String value) { if (this.className == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( newValue, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#declaringClassName() declaringClassName}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for declaringClassName * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withDeclaringClassName(String value) { if (this.declaringClassName == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, newValue, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodName() methodName}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for methodName * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodName(String value) { if (this.methodName == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, newValue, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object with elements that replace content of {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes}. * @param elements elements to set * @return modified copy of {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodParameterTypes(String... elements) { ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, newValue, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object with elements that replace content of {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements iterable of methodParameterTypes elements to set * @return modified copy of {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodParameterTypes(Iterable elements) { if (this.methodParameterTypes == elements) return this; ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, newValue, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodReturnType() methodReturnType}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for methodReturnType * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodReturnType(String value) { if (this.methodReturnType == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, newValue, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object with elements that replace content of {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers}. * @param elements elements to set * @return modified copy of {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodModifiers(InstrumentationConfig.MethodModifier... elements) { ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, newValue, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object with elements that replace content of {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements iterable of methodModifiers elements to set * @return modified copy of {@code this} object */ public final ImmutableInstrumentationConfigDto withMethodModifiers(Iterable elements) { if (this.methodModifiers == elements) return this; ImmutableList newValue = ImmutableList.copyOf(elements); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, newValue, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#captureKind() captureKind}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for captureKind * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withCaptureKind(InstrumentationConfig.CaptureKind value) { if (this.captureKind == value) return this; InstrumentationConfig.CaptureKind newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, newValue, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#timerName() timerName}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for timerName * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTimerName(String value) { if (this.timerName == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, newValue, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryMessageTemplate() traceEntryMessageTemplate}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for traceEntryMessageTemplate * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTraceEntryMessageTemplate(String value) { if (this.traceEntryMessageTemplate == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, newValue, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryStackThresholdMillis() traceEntryStackThresholdMillis}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for traceEntryStackThresholdMillis, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTraceEntryStackThresholdMillis(@Nullable Integer value) { if (this.traceEntryStackThresholdMillis == value) return this; @Nullable Integer newValue = value; return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, newValue, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryCaptureSelfNested() traceEntryCaptureSelfNested}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for traceEntryCaptureSelfNested * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTraceEntryCaptureSelfNested(boolean value) { if (this.traceEntryCaptureSelfNested == value) return this; boolean newValue = value; return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, newValue, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionType() transactionType}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionType * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTransactionType(String value) { if (this.transactionType == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, newValue, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionNameTemplate() transactionNameTemplate}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionNameTemplate * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTransactionNameTemplate(String value) { if (this.transactionNameTemplate == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, newValue, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionUserTemplate() transactionUserTemplate}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionUserTemplate * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTransactionUserTemplate(String value) { if (this.transactionUserTemplate == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, newValue, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by replacing {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionAttributeTemplates() transactionAttributeTemplates} map with specified map. * Nulls are not permitted as keys or values. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries to be added to transactionAttributeTemplates map * @return modified copy of {@code this} object */ public final ImmutableInstrumentationConfigDto withTransactionAttributeTemplates(Map entries) { if (this.transactionAttributeTemplates == entries) return this; ImmutableMap newValue = ImmutableMap.copyOf(entries); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, newValue, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionSlowThresholdMillis() transactionSlowThresholdMillis}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionSlowThresholdMillis, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTransactionSlowThresholdMillis(@Nullable Integer value) { if (this.transactionSlowThresholdMillis == value) return this; @Nullable Integer newValue = value; return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, newValue, this.enabledProperty, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#enabledProperty() enabledProperty}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for enabledProperty * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withEnabledProperty(String value) { if (this.enabledProperty == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, newValue, this.traceEntryEnabledProperty, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryEnabledProperty() traceEntryEnabledProperty}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for traceEntryEnabledProperty * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withTraceEntryEnabledProperty(String value) { if (this.traceEntryEnabledProperty == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, newValue, this.version); } /** * Copy current immutable object by setting value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#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, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableInstrumentationConfigDto withVersion(@Nullable String value) { if (this.version == value) return this; @Nullable String newValue = value; return new ImmutableInstrumentationConfigDto( this.className, this.declaringClassName, this.methodName, this.methodParameterTypes, this.methodReturnType, this.methodModifiers, this.captureKind, this.timerName, this.traceEntryMessageTemplate, this.traceEntryStackThresholdMillis, this.traceEntryCaptureSelfNested, this.transactionType, this.transactionNameTemplate, this.transactionUserTemplate, this.transactionAttributeTemplates, this.transactionSlowThresholdMillis, this.enabledProperty, this.traceEntryEnabledProperty, newValue); } /** * This instance is equal to instances of {@code ImmutableInstrumentationConfigDto} 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 ImmutableInstrumentationConfigDto && equalTo((ImmutableInstrumentationConfigDto) another); } private boolean equalTo(ImmutableInstrumentationConfigDto another) { return className.equals(another.className) && declaringClassName.equals(another.declaringClassName) && methodName.equals(another.methodName) && methodParameterTypes.equals(another.methodParameterTypes) && methodReturnType.equals(another.methodReturnType) && methodModifiers.equals(another.methodModifiers) && captureKind.equals(another.captureKind) && timerName.equals(another.timerName) && traceEntryMessageTemplate.equals(another.traceEntryMessageTemplate) && Objects.equal(traceEntryStackThresholdMillis, another.traceEntryStackThresholdMillis) && traceEntryCaptureSelfNested == another.traceEntryCaptureSelfNested && transactionType.equals(another.transactionType) && transactionNameTemplate.equals(another.transactionNameTemplate) && transactionUserTemplate.equals(another.transactionUserTemplate) && transactionAttributeTemplates.equals(another.transactionAttributeTemplates) && Objects.equal(transactionSlowThresholdMillis, another.transactionSlowThresholdMillis) && enabledProperty.equals(another.enabledProperty) && traceEntryEnabledProperty.equals(another.traceEntryEnabledProperty) && Objects.equal(version, another.version); } /** * Computes hash code from attributes: {@code className}, {@code declaringClassName}, {@code methodName}, {@code methodParameterTypes}, {@code methodReturnType}, {@code methodModifiers}, {@code captureKind}, {@code timerName}, {@code traceEntryMessageTemplate}, {@code traceEntryStackThresholdMillis}, {@code traceEntryCaptureSelfNested}, {@code transactionType}, {@code transactionNameTemplate}, {@code transactionUserTemplate}, {@code transactionAttributeTemplates}, {@code transactionSlowThresholdMillis}, {@code enabledProperty}, {@code traceEntryEnabledProperty}, {@code version}. * @return hashCode value */ @Override public int hashCode() { int h = 31; h = h * 17 + className.hashCode(); h = h * 17 + declaringClassName.hashCode(); h = h * 17 + methodName.hashCode(); h = h * 17 + methodParameterTypes.hashCode(); h = h * 17 + methodReturnType.hashCode(); h = h * 17 + methodModifiers.hashCode(); h = h * 17 + captureKind.hashCode(); h = h * 17 + timerName.hashCode(); h = h * 17 + traceEntryMessageTemplate.hashCode(); h = h * 17 + Objects.hashCode(traceEntryStackThresholdMillis); h = h * 17 + Booleans.hashCode(traceEntryCaptureSelfNested); h = h * 17 + transactionType.hashCode(); h = h * 17 + transactionNameTemplate.hashCode(); h = h * 17 + transactionUserTemplate.hashCode(); h = h * 17 + transactionAttributeTemplates.hashCode(); h = h * 17 + Objects.hashCode(transactionSlowThresholdMillis); h = h * 17 + enabledProperty.hashCode(); h = h * 17 + traceEntryEnabledProperty.hashCode(); h = h * 17 + Objects.hashCode(version); return h; } /** * Prints immutable value {@code InstrumentationConfigDto...} with attribute values, * excluding any non-generated and auxiliary attributes. * @return string representation of value */ @Override public String toString() { return MoreObjects.toStringHelper("InstrumentationConfigDto") .add("className", className) .add("declaringClassName", declaringClassName) .add("methodName", methodName) .add("methodParameterTypes", methodParameterTypes) .add("methodReturnType", methodReturnType) .add("methodModifiers", methodModifiers) .add("captureKind", captureKind) .add("timerName", timerName) .add("traceEntryMessageTemplate", traceEntryMessageTemplate) .add("traceEntryStackThresholdMillis", traceEntryStackThresholdMillis) .add("traceEntryCaptureSelfNested", traceEntryCaptureSelfNested) .add("transactionType", transactionType) .add("transactionNameTemplate", transactionNameTemplate) .add("transactionUserTemplate", transactionUserTemplate) .add("transactionAttributeTemplates", transactionAttributeTemplates) .add("transactionSlowThresholdMillis", transactionSlowThresholdMillis) .add("enabledProperty", enabledProperty) .add("traceEntryEnabledProperty", traceEntryEnabledProperty) .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 String className; @JsonProperty @Nullable String declaringClassName; @JsonProperty @Nullable String methodName; @JsonProperty @Nullable ImmutableList methodParameterTypes; @JsonProperty @Nullable String methodReturnType; @JsonProperty @Nullable ImmutableList methodModifiers; @JsonProperty @Nullable InstrumentationConfig.CaptureKind captureKind; @JsonProperty @Nullable String timerName; @JsonProperty @Nullable String traceEntryMessageTemplate; @JsonProperty @Nullable Integer traceEntryStackThresholdMillis; @JsonProperty @Nullable Boolean traceEntryCaptureSelfNested; @JsonProperty @Nullable String transactionType; @JsonProperty @Nullable String transactionNameTemplate; @JsonProperty @Nullable String transactionUserTemplate; @JsonProperty @Nullable Map transactionAttributeTemplates; @JsonProperty @Nullable Integer transactionSlowThresholdMillis; @JsonProperty @Nullable String enabledProperty; @JsonProperty @Nullable String traceEntryEnabledProperty; @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 ImmutableInstrumentationConfigDto fromJson(Json json) { ImmutableInstrumentationConfigDto.Builder builder = ImmutableInstrumentationConfigDto.builder(); if (json.className != null) { builder.className(json.className); } if (json.declaringClassName != null) { builder.declaringClassName(json.declaringClassName); } if (json.methodName != null) { builder.methodName(json.methodName); } if (json.methodParameterTypes != null) { builder.addAllMethodParameterTypes(json.methodParameterTypes); } if (json.methodReturnType != null) { builder.methodReturnType(json.methodReturnType); } if (json.methodModifiers != null) { builder.addAllMethodModifiers(json.methodModifiers); } if (json.captureKind != null) { builder.captureKind(json.captureKind); } if (json.timerName != null) { builder.timerName(json.timerName); } if (json.traceEntryMessageTemplate != null) { builder.traceEntryMessageTemplate(json.traceEntryMessageTemplate); } if (json.traceEntryStackThresholdMillis != null) { builder.traceEntryStackThresholdMillis(json.traceEntryStackThresholdMillis); } if (json.traceEntryCaptureSelfNested != null) { builder.traceEntryCaptureSelfNested(json.traceEntryCaptureSelfNested); } if (json.transactionType != null) { builder.transactionType(json.transactionType); } if (json.transactionNameTemplate != null) { builder.transactionNameTemplate(json.transactionNameTemplate); } if (json.transactionUserTemplate != null) { builder.transactionUserTemplate(json.transactionUserTemplate); } if (json.transactionAttributeTemplates != null) { builder.putAllTransactionAttributeTemplates(json.transactionAttributeTemplates); } if (json.transactionSlowThresholdMillis != null) { builder.transactionSlowThresholdMillis(json.transactionSlowThresholdMillis); } if (json.enabledProperty != null) { builder.enabledProperty(json.enabledProperty); } if (json.traceEntryEnabledProperty != null) { builder.traceEntryEnabledProperty(json.traceEntryEnabledProperty); } if (json.version != null) { builder.version(json.version); } return builder.build(); } /** * Creates immutable copy of {@link InstrumentationConfigJsonService.InstrumentationConfigDto}. * 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 InstrumentationConfigDto instance */ static ImmutableInstrumentationConfigDto copyOf(InstrumentationConfigJsonService.InstrumentationConfigDto instance) { if (instance instanceof ImmutableInstrumentationConfigDto) { return (ImmutableInstrumentationConfigDto) instance; } return ImmutableInstrumentationConfigDto.builder() .copyFrom(instance) .build(); } /** * Creates builder for {@link org.glowroot.ui.ImmutableInstrumentationConfigDto ImmutableInstrumentationConfigDto}. * @return new ImmutableInstrumentationConfigDto builder */ static ImmutableInstrumentationConfigDto.Builder builder() { return new ImmutableInstrumentationConfigDto.Builder(); } /** * Builds instances of {@link org.glowroot.ui.ImmutableInstrumentationConfigDto ImmutableInstrumentationConfigDto}. * 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_CLASS_NAME = 0x1L; private static final long INIT_BIT_DECLARING_CLASS_NAME = 0x2L; private static final long INIT_BIT_METHOD_NAME = 0x4L; private static final long INIT_BIT_METHOD_RETURN_TYPE = 0x8L; private static final long INIT_BIT_CAPTURE_KIND = 0x10L; private static final long INIT_BIT_TIMER_NAME = 0x20L; private static final long INIT_BIT_TRACE_ENTRY_MESSAGE_TEMPLATE = 0x40L; private static final long INIT_BIT_TRACE_ENTRY_CAPTURE_SELF_NESTED = 0x80L; private static final long INIT_BIT_TRANSACTION_TYPE = 0x100L; private static final long INIT_BIT_TRANSACTION_NAME_TEMPLATE = 0x200L; private static final long INIT_BIT_TRANSACTION_USER_TEMPLATE = 0x400L; private static final long INIT_BIT_ENABLED_PROPERTY = 0x800L; private static final long INIT_BIT_TRACE_ENTRY_ENABLED_PROPERTY = 0x1000L; private long initBits = 0x1fff; private @Nullable String className; private @Nullable String declaringClassName; private @Nullable String methodName; private ImmutableList.Builder methodParameterTypesBuilder = ImmutableList.builder(); private @Nullable String methodReturnType; private ImmutableList.Builder methodModifiersBuilder = ImmutableList.builder(); private @Nullable InstrumentationConfig.CaptureKind captureKind; private @Nullable String timerName; private @Nullable String traceEntryMessageTemplate; private @Nullable Integer traceEntryStackThresholdMillis; private boolean traceEntryCaptureSelfNested; private @Nullable String transactionType; private @Nullable String transactionNameTemplate; private @Nullable String transactionUserTemplate; private ImmutableMap.Builder transactionAttributeTemplatesBuilder = ImmutableMap.builder(); private @Nullable Integer transactionSlowThresholdMillis; private @Nullable String enabledProperty; private @Nullable String traceEntryEnabledProperty; private @Nullable String version; private Builder() {} /** * Fill builder with attribute values from provided {@link InstrumentationConfigJsonService.InstrumentationConfigDto} instance. * Regular attribute values will be replaced with ones of an instance. * Instance's absent optional values will not replace present values. * Collection elements and entries will be added, not replaced. * @param instance instance to copy values from * @return {@code this} builder for chained invocation */ public final Builder copyFrom(InstrumentationConfigJsonService.InstrumentationConfigDto instance) { Preconditions.checkNotNull(instance); className(instance.className()); declaringClassName(instance.declaringClassName()); methodName(instance.methodName()); addAllMethodParameterTypes(instance.methodParameterTypes()); methodReturnType(instance.methodReturnType()); addAllMethodModifiers(instance.methodModifiers()); captureKind(instance.captureKind()); timerName(instance.timerName()); traceEntryMessageTemplate(instance.traceEntryMessageTemplate()); @Nullable Integer traceEntryStackThresholdMillisValue = instance.traceEntryStackThresholdMillis(); if (traceEntryStackThresholdMillisValue != null) { traceEntryStackThresholdMillis(traceEntryStackThresholdMillisValue); } traceEntryCaptureSelfNested(instance.traceEntryCaptureSelfNested()); transactionType(instance.transactionType()); transactionNameTemplate(instance.transactionNameTemplate()); transactionUserTemplate(instance.transactionUserTemplate()); putAllTransactionAttributeTemplates(instance.transactionAttributeTemplates()); @Nullable Integer transactionSlowThresholdMillisValue = instance.transactionSlowThresholdMillis(); if (transactionSlowThresholdMillisValue != null) { transactionSlowThresholdMillis(transactionSlowThresholdMillisValue); } enabledProperty(instance.enabledProperty()); traceEntryEnabledProperty(instance.traceEntryEnabledProperty()); @Nullable String versionValue = instance.version(); if (versionValue != null) { version(versionValue); } return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#className() className}. * @param className value for className * @return {@code this} builder for chained invocation */ public final Builder className(String className) { this.className = Preconditions.checkNotNull(className); initBits &= ~INIT_BIT_CLASS_NAME; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#declaringClassName() declaringClassName}. * @param declaringClassName value for declaringClassName * @return {@code this} builder for chained invocation */ public final Builder declaringClassName(String declaringClassName) { this.declaringClassName = Preconditions.checkNotNull(declaringClassName); initBits &= ~INIT_BIT_DECLARING_CLASS_NAME; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodName() methodName}. * @param methodName value for methodName * @return {@code this} builder for chained invocation */ public final Builder methodName(String methodName) { this.methodName = Preconditions.checkNotNull(methodName); initBits &= ~INIT_BIT_METHOD_NAME; return this; } /** * Adds one element to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes} list. * @param element methodParameterTypes element * @return {@code this} builder for chained invocation */ public final Builder addMethodParameterTypes(String element) { methodParameterTypesBuilder.add(element); return this; } /** * Adds elements to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes} list. * @param elements array of methodParameterTypes elements * @return {@code this} builder for chained invocation */ public final Builder addMethodParameterTypes(String... elements) { methodParameterTypesBuilder.add(elements); return this; } /** * Sets or replaces all elements for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes} list. * @param elements iterable of methodParameterTypes elements * @return {@code this} builder for chained invocation */ public final Builder methodParameterTypes(Iterable elements) { methodParameterTypesBuilder = ImmutableList.builder(); return addAllMethodParameterTypes(elements); } /** * Adds elements to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodParameterTypes() methodParameterTypes} list. * @param elements iterable of methodParameterTypes elements * @return {@code this} builder for chained invocation */ public final Builder addAllMethodParameterTypes(Iterable elements) { methodParameterTypesBuilder.addAll(elements); return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodReturnType() methodReturnType}. * @param methodReturnType value for methodReturnType * @return {@code this} builder for chained invocation */ public final Builder methodReturnType(String methodReturnType) { this.methodReturnType = Preconditions.checkNotNull(methodReturnType); initBits &= ~INIT_BIT_METHOD_RETURN_TYPE; return this; } /** * Adds one element to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers} list. * @param element methodModifiers element * @return {@code this} builder for chained invocation */ public final Builder addMethodModifiers(InstrumentationConfig.MethodModifier element) { methodModifiersBuilder.add(element); return this; } /** * Adds elements to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers} list. * @param elements array of methodModifiers elements * @return {@code this} builder for chained invocation */ public final Builder addMethodModifiers(InstrumentationConfig.MethodModifier... elements) { methodModifiersBuilder.add(elements); return this; } /** * Sets or replaces all elements for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers} list. * @param elements iterable of methodModifiers elements * @return {@code this} builder for chained invocation */ public final Builder methodModifiers(Iterable elements) { methodModifiersBuilder = ImmutableList.builder(); return addAllMethodModifiers(elements); } /** * Adds elements to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#methodModifiers() methodModifiers} list. * @param elements iterable of methodModifiers elements * @return {@code this} builder for chained invocation */ public final Builder addAllMethodModifiers(Iterable elements) { methodModifiersBuilder.addAll(elements); return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#captureKind() captureKind}. * @param captureKind value for captureKind * @return {@code this} builder for chained invocation */ public final Builder captureKind(InstrumentationConfig.CaptureKind captureKind) { this.captureKind = Preconditions.checkNotNull(captureKind); initBits &= ~INIT_BIT_CAPTURE_KIND; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#timerName() timerName}. * @param timerName value for timerName * @return {@code this} builder for chained invocation */ public final Builder timerName(String timerName) { this.timerName = Preconditions.checkNotNull(timerName); initBits &= ~INIT_BIT_TIMER_NAME; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryMessageTemplate() traceEntryMessageTemplate}. * @param traceEntryMessageTemplate value for traceEntryMessageTemplate * @return {@code this} builder for chained invocation */ public final Builder traceEntryMessageTemplate(String traceEntryMessageTemplate) { this.traceEntryMessageTemplate = Preconditions.checkNotNull(traceEntryMessageTemplate); initBits &= ~INIT_BIT_TRACE_ENTRY_MESSAGE_TEMPLATE; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryStackThresholdMillis() traceEntryStackThresholdMillis}. * @param traceEntryStackThresholdMillis value for traceEntryStackThresholdMillis, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder traceEntryStackThresholdMillis(@Nullable Integer traceEntryStackThresholdMillis) { this.traceEntryStackThresholdMillis = traceEntryStackThresholdMillis; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryCaptureSelfNested() traceEntryCaptureSelfNested}. * @param traceEntryCaptureSelfNested value for traceEntryCaptureSelfNested * @return {@code this} builder for chained invocation */ public final Builder traceEntryCaptureSelfNested(boolean traceEntryCaptureSelfNested) { this.traceEntryCaptureSelfNested = traceEntryCaptureSelfNested; initBits &= ~INIT_BIT_TRACE_ENTRY_CAPTURE_SELF_NESTED; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionType() transactionType}. * @param transactionType value for transactionType * @return {@code this} builder for chained invocation */ public final Builder transactionType(String transactionType) { this.transactionType = Preconditions.checkNotNull(transactionType); initBits &= ~INIT_BIT_TRANSACTION_TYPE; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionNameTemplate() transactionNameTemplate}. * @param transactionNameTemplate value for transactionNameTemplate * @return {@code this} builder for chained invocation */ public final Builder transactionNameTemplate(String transactionNameTemplate) { this.transactionNameTemplate = Preconditions.checkNotNull(transactionNameTemplate); initBits &= ~INIT_BIT_TRANSACTION_NAME_TEMPLATE; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionUserTemplate() transactionUserTemplate}. * @param transactionUserTemplate value for transactionUserTemplate * @return {@code this} builder for chained invocation */ public final Builder transactionUserTemplate(String transactionUserTemplate) { this.transactionUserTemplate = Preconditions.checkNotNull(transactionUserTemplate); initBits &= ~INIT_BIT_TRANSACTION_USER_TEMPLATE; return this; } /** * Put one entry to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionAttributeTemplates() transactionAttributeTemplates} map. * @param key the key in transactionAttributeTemplates map * @param value the associated value in transactionAttributeTemplates map * @return {@code this} builder for chained invocation */ public final Builder putTransactionAttributeTemplates(String key, String value) { transactionAttributeTemplatesBuilder.put(key, value); return this; } /** * Put one entry to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionAttributeTemplates() transactionAttributeTemplates} map. Nulls are not permitted * @param entry the key and value entry * @return {@code this} builder for chained invocation */ public final Builder putTransactionAttributeTemplates(Map.Entry entry) { transactionAttributeTemplatesBuilder.put(entry); return this; } /** * Sets or replaces all mappings from specified map as entries for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionAttributeTemplates() transactionAttributeTemplates} map. Nulls are not permitted * @param entries to be added to transactionAttributeTemplates map * @return {@code this} builder for chained invocation */ public final Builder transactionAttributeTemplates(Map entries) { transactionAttributeTemplatesBuilder = ImmutableMap.builder(); return putAllTransactionAttributeTemplates(entries); } /** * Put all mappings from specified map as entries to {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionAttributeTemplates() transactionAttributeTemplates} map. Nulls are not permitted * @param entries to be added to transactionAttributeTemplates map * @return {@code this} builder for chained invocation */ public final Builder putAllTransactionAttributeTemplates(Map entries) { transactionAttributeTemplatesBuilder.putAll(entries); return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#transactionSlowThresholdMillis() transactionSlowThresholdMillis}. * @param transactionSlowThresholdMillis value for transactionSlowThresholdMillis, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder transactionSlowThresholdMillis(@Nullable Integer transactionSlowThresholdMillis) { this.transactionSlowThresholdMillis = transactionSlowThresholdMillis; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#enabledProperty() enabledProperty}. * @param enabledProperty value for enabledProperty * @return {@code this} builder for chained invocation */ public final Builder enabledProperty(String enabledProperty) { this.enabledProperty = Preconditions.checkNotNull(enabledProperty); initBits &= ~INIT_BIT_ENABLED_PROPERTY; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#traceEntryEnabledProperty() traceEntryEnabledProperty}. * @param traceEntryEnabledProperty value for traceEntryEnabledProperty * @return {@code this} builder for chained invocation */ public final Builder traceEntryEnabledProperty(String traceEntryEnabledProperty) { this.traceEntryEnabledProperty = Preconditions.checkNotNull(traceEntryEnabledProperty); initBits &= ~INIT_BIT_TRACE_ENTRY_ENABLED_PROPERTY; return this; } /** * Initializes value for {@link InstrumentationConfigJsonService.InstrumentationConfigDto#version() version}. * @param version value for version, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder version(@Nullable String version) { this.version = version; return this; } /** * Builds new {@link org.glowroot.ui.ImmutableInstrumentationConfigDto ImmutableInstrumentationConfigDto}. * @return immutable instance of InstrumentationConfigDto * @throws exception {@code java.lang.IllegalStateException} if any required attributes are missing */ public ImmutableInstrumentationConfigDto build() throws IllegalStateException { checkRequiredAttributes(); return new ImmutableInstrumentationConfigDto( className, declaringClassName, methodName, methodParameterTypesBuilder.build(), methodReturnType, methodModifiersBuilder.build(), captureKind, timerName, traceEntryMessageTemplate, traceEntryStackThresholdMillis, traceEntryCaptureSelfNested, transactionType, transactionNameTemplate, transactionUserTemplate, transactionAttributeTemplatesBuilder.build(), transactionSlowThresholdMillis, enabledProperty, traceEntryEnabledProperty, version); } private boolean classNameIsSet() { return (initBits & INIT_BIT_CLASS_NAME) == 0; } private boolean declaringClassNameIsSet() { return (initBits & INIT_BIT_DECLARING_CLASS_NAME) == 0; } private boolean methodNameIsSet() { return (initBits & INIT_BIT_METHOD_NAME) == 0; } private boolean methodReturnTypeIsSet() { return (initBits & INIT_BIT_METHOD_RETURN_TYPE) == 0; } private boolean captureKindIsSet() { return (initBits & INIT_BIT_CAPTURE_KIND) == 0; } private boolean timerNameIsSet() { return (initBits & INIT_BIT_TIMER_NAME) == 0; } private boolean traceEntryMessageTemplateIsSet() { return (initBits & INIT_BIT_TRACE_ENTRY_MESSAGE_TEMPLATE) == 0; } private boolean traceEntryCaptureSelfNestedIsSet() { return (initBits & INIT_BIT_TRACE_ENTRY_CAPTURE_SELF_NESTED) == 0; } private boolean transactionTypeIsSet() { return (initBits & INIT_BIT_TRANSACTION_TYPE) == 0; } private boolean transactionNameTemplateIsSet() { return (initBits & INIT_BIT_TRANSACTION_NAME_TEMPLATE) == 0; } private boolean transactionUserTemplateIsSet() { return (initBits & INIT_BIT_TRANSACTION_USER_TEMPLATE) == 0; } private boolean enabledPropertyIsSet() { return (initBits & INIT_BIT_ENABLED_PROPERTY) == 0; } private boolean traceEntryEnabledPropertyIsSet() { return (initBits & INIT_BIT_TRACE_ENTRY_ENABLED_PROPERTY) == 0; } private void checkRequiredAttributes() throws IllegalStateException { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } } private String formatRequiredAttributesMessage() { List attributes = Lists.newArrayList(); if (!classNameIsSet()) attributes.add("className"); if (!declaringClassNameIsSet()) attributes.add("declaringClassName"); if (!methodNameIsSet()) attributes.add("methodName"); if (!methodReturnTypeIsSet()) attributes.add("methodReturnType"); if (!captureKindIsSet()) attributes.add("captureKind"); if (!timerNameIsSet()) attributes.add("timerName"); if (!traceEntryMessageTemplateIsSet()) attributes.add("traceEntryMessageTemplate"); if (!traceEntryCaptureSelfNestedIsSet()) attributes.add("traceEntryCaptureSelfNested"); if (!transactionTypeIsSet()) attributes.add("transactionType"); if (!transactionNameTemplateIsSet()) attributes.add("transactionNameTemplate"); if (!transactionUserTemplateIsSet()) attributes.add("transactionUserTemplate"); if (!enabledPropertyIsSet()) attributes.add("enabledProperty"); if (!traceEntryEnabledPropertyIsSet()) attributes.add("traceEntryEnabledProperty"); return "Cannot build InstrumentationConfigDto, some of required attributes are not set " + attributes; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy