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

org.glowroot.ui.ImmutableTracePointRequest 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.Lists;
import org.glowroot.agent.shaded.google.common.primitives.Booleans;
import org.glowroot.agent.shaded.google.common.primitives.Doubles;
import org.glowroot.agent.shaded.google.common.primitives.Longs;
import java.util.ArrayList;
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;
import org.glowroot.common.live.StringComparator;

/**
 * Immutable implementation of {@link TracePointJsonService.TracePointRequest}.
 * 

* Use builder to create immutable instances: * {@code ImmutableTracePointRequest.builder()}. */ @SuppressWarnings("all") @ParametersAreNonnullByDefault @Generated({"Immutables.generator", "TracePointJsonService.TracePointRequest"}) @Immutable public final class ImmutableTracePointRequest extends TracePointJsonService.TracePointRequest { private final String serverRollup; private final long from; private final long to; private final double responseTimeMillisLow; private final @Nullable java.lang.Double responseTimeMillisHigh; private final @Nullable String transactionType; private final @Nullable StringComparator transactionNameComparator; private final @Nullable String transactionName; private final @Nullable StringComparator headlineComparator; private final @Nullable String headline; private final @Nullable StringComparator errorComparator; private final @Nullable String error; private final @Nullable StringComparator userComparator; private final @Nullable String user; private final @Nullable String attributeName; private final @Nullable StringComparator attributeValueComparator; private final @Nullable String attributeValue; private final boolean slowOnly; private final boolean errorOnly; private final int limit; private ImmutableTracePointRequest(ImmutableTracePointRequest.Builder builder) { this.serverRollup = builder.serverRollup; this.from = builder.from; this.to = builder.to; this.responseTimeMillisLow = builder.responseTimeMillisLow; this.responseTimeMillisHigh = builder.responseTimeMillisHigh; this.transactionType = builder.transactionType; this.transactionNameComparator = builder.transactionNameComparator; this.transactionName = builder.transactionName; this.headlineComparator = builder.headlineComparator; this.headline = builder.headline; this.errorComparator = builder.errorComparator; this.error = builder.error; this.userComparator = builder.userComparator; this.user = builder.user; this.attributeName = builder.attributeName; this.attributeValueComparator = builder.attributeValueComparator; this.attributeValue = builder.attributeValue; this.limit = builder.limit; if (builder.slowOnlyIsSet()) { initShim.slowOnly(builder.slowOnly); } if (builder.errorOnlyIsSet()) { initShim.errorOnly(builder.errorOnly); } this.slowOnly = initShim.slowOnly(); this.errorOnly = initShim.errorOnly(); 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 slowOnly; private byte slowOnlyStage; boolean slowOnly() { if (slowOnlyStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (slowOnlyStage == STAGE_UNINITIALIZED) { slowOnlyStage = STAGE_INITIALIZING; this.slowOnly = ImmutableTracePointRequest.super.slowOnly(); slowOnlyStage = STAGE_INITIALIZED; } return slowOnly; } boolean slowOnly(boolean value) { this.slowOnly = value; slowOnlyStage = STAGE_INITIALIZED; return value; } private boolean errorOnly; private byte errorOnlyStage; boolean errorOnly() { if (errorOnlyStage == STAGE_INITIALIZING) throw new IllegalStateException(formatInitCycleMessage()); if (errorOnlyStage == STAGE_UNINITIALIZED) { errorOnlyStage = STAGE_INITIALIZING; this.errorOnly = ImmutableTracePointRequest.super.errorOnly(); errorOnlyStage = STAGE_INITIALIZED; } return errorOnly; } boolean errorOnly(boolean value) { this.errorOnly = value; errorOnlyStage = STAGE_INITIALIZED; return value; } private String formatInitCycleMessage() { ArrayList attributes = Lists.newArrayList();; if (slowOnlyStage == STAGE_INITIALIZING) attributes.add("slowOnly"); if (errorOnlyStage == STAGE_INITIALIZING) attributes.add("errorOnly"); return "Cannot build TracePointRequest, attribute initializers form cycle" + attributes; } } private ImmutableTracePointRequest( String serverRollup, long from, long to, double responseTimeMillisLow, @Nullable java.lang.Double responseTimeMillisHigh, @Nullable String transactionType, @Nullable StringComparator transactionNameComparator, @Nullable String transactionName, @Nullable StringComparator headlineComparator, @Nullable String headline, @Nullable StringComparator errorComparator, @Nullable String error, @Nullable StringComparator userComparator, @Nullable String user, @Nullable String attributeName, @Nullable StringComparator attributeValueComparator, @Nullable String attributeValue, boolean slowOnly, boolean errorOnly, int limit) { this.serverRollup = serverRollup; this.from = from; this.to = to; this.responseTimeMillisLow = responseTimeMillisLow; this.responseTimeMillisHigh = responseTimeMillisHigh; this.transactionType = transactionType; this.transactionNameComparator = transactionNameComparator; this.transactionName = transactionName; this.headlineComparator = headlineComparator; this.headline = headline; this.errorComparator = errorComparator; this.error = error; this.userComparator = userComparator; this.user = user; this.attributeName = attributeName; this.attributeValueComparator = attributeValueComparator; this.attributeValue = attributeValue; this.slowOnly = slowOnly; this.errorOnly = errorOnly; this.limit = limit; this.initShim = null; } /** * @return value of {@code serverRollup} attribute */ @JsonProperty @Override public String serverRollup() { return serverRollup; } /** * @return value of {@code from} attribute */ @JsonProperty @Override public long from() { return from; } /** * @return value of {@code to} attribute */ @JsonProperty @Override public long to() { return to; } /** * @return value of {@code responseTimeMillisLow} attribute */ @JsonProperty @Override public double responseTimeMillisLow() { return responseTimeMillisLow; } /** * @return value of {@code responseTimeMillisHigh} attribute */ @JsonProperty @Override public @Nullable java.lang.Double responseTimeMillisHigh() { return responseTimeMillisHigh; } /** * @return value of {@code transactionType} attribute */ @JsonProperty @Override public @Nullable String transactionType() { return transactionType; } /** * @return value of {@code transactionNameComparator} attribute */ @JsonProperty @Override public @Nullable StringComparator transactionNameComparator() { return transactionNameComparator; } /** * @return value of {@code transactionName} attribute */ @JsonProperty @Override public @Nullable String transactionName() { return transactionName; } /** * @return value of {@code headlineComparator} attribute */ @JsonProperty @Override public @Nullable StringComparator headlineComparator() { return headlineComparator; } /** * @return value of {@code headline} attribute */ @JsonProperty @Override public @Nullable String headline() { return headline; } /** * @return value of {@code errorComparator} attribute */ @JsonProperty @Override public @Nullable StringComparator errorComparator() { return errorComparator; } /** * @return value of {@code error} attribute */ @JsonProperty @Override public @Nullable String error() { return error; } /** * @return value of {@code userComparator} attribute */ @JsonProperty @Override public @Nullable StringComparator userComparator() { return userComparator; } /** * @return value of {@code user} attribute */ @JsonProperty @Override public @Nullable String user() { return user; } /** * @return value of {@code attributeName} attribute */ @JsonProperty @Override public @Nullable String attributeName() { return attributeName; } /** * @return value of {@code attributeValueComparator} attribute */ @JsonProperty @Override public @Nullable StringComparator attributeValueComparator() { return attributeValueComparator; } /** * @return value of {@code attributeValue} attribute */ @JsonProperty @Override public @Nullable String attributeValue() { return attributeValue; } /** * @return value of {@code slowOnly} attribute */ @JsonProperty @Override public boolean slowOnly() { return initShim != null ? initShim.slowOnly() : slowOnly; } /** * @return value of {@code errorOnly} attribute */ @JsonProperty @Override public boolean errorOnly() { return initShim != null ? initShim.errorOnly() : errorOnly; } /** * @return value of {@code limit} attribute */ @JsonProperty @Override public int limit() { return limit; } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#serverRollup() serverRollup}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for serverRollup * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withServerRollup(String value) { if (this.serverRollup == value) return this; String newValue = Preconditions.checkNotNull(value); return new ImmutableTracePointRequest( newValue, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#from() from}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for from * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withFrom(long value) { if (this.from == value) return this; long newValue = value; return new ImmutableTracePointRequest( this.serverRollup, newValue, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#to() to}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for to * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withTo(long value) { if (this.to == value) return this; long newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, newValue, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#responseTimeMillisLow() responseTimeMillisLow}. * @param value new value for responseTimeMillisLow * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withResponseTimeMillisLow(double value) { double newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, newValue, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#responseTimeMillisHigh() responseTimeMillisHigh}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for responseTimeMillisHigh, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withResponseTimeMillisHigh(@Nullable java.lang.Double value) { if (this.responseTimeMillisHigh == value) return this; @Nullable java.lang.Double newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, newValue, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#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, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withTransactionType(@Nullable String value) { if (this.transactionType == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, newValue, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#transactionNameComparator() transactionNameComparator}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionNameComparator, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withTransactionNameComparator(@Nullable StringComparator value) { if (this.transactionNameComparator == value) return this; @Nullable StringComparator newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, newValue, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#transactionName() transactionName}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for transactionName, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withTransactionName(@Nullable String value) { if (this.transactionName == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, newValue, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#headlineComparator() headlineComparator}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for headlineComparator, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withHeadlineComparator(@Nullable StringComparator value) { if (this.headlineComparator == value) return this; @Nullable StringComparator newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, newValue, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#headline() headline}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for headline, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withHeadline(@Nullable String value) { if (this.headline == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, newValue, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#errorComparator() errorComparator}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for errorComparator, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withErrorComparator(@Nullable StringComparator value) { if (this.errorComparator == value) return this; @Nullable StringComparator newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, newValue, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#error() error}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for error, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withError(@Nullable String value) { if (this.error == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, newValue, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#userComparator() userComparator}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for userComparator, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withUserComparator(@Nullable StringComparator value) { if (this.userComparator == value) return this; @Nullable StringComparator newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, newValue, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#user() user}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for user, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withUser(@Nullable String value) { if (this.user == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, newValue, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#attributeName() attributeName}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for attributeName, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withAttributeName(@Nullable String value) { if (this.attributeName == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, newValue, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#attributeValueComparator() attributeValueComparator}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for attributeValueComparator, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withAttributeValueComparator(@Nullable StringComparator value) { if (this.attributeValueComparator == value) return this; @Nullable StringComparator newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, newValue, this.attributeValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#attributeValue() attributeValue}. * Shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for attributeValue, can be {@code null} * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withAttributeValue(@Nullable String value) { if (this.attributeValue == value) return this; @Nullable String newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, newValue, this.slowOnly, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#slowOnly() slowOnly}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for slowOnly * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withSlowOnly(boolean value) { if (this.slowOnly == value) return this; boolean newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, newValue, this.errorOnly, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#errorOnly() errorOnly}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for errorOnly * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withErrorOnly(boolean value) { if (this.errorOnly == value) return this; boolean newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, newValue, this.limit); } /** * Copy current immutable object by setting value for {@link TracePointJsonService.TracePointRequest#limit() limit}. * Value equality check is used to prevent copying of the same value by returning {@code this}. * @param value new value for limit * @return modified copy of the {@code this} object */ public final ImmutableTracePointRequest withLimit(int value) { if (this.limit == value) return this; int newValue = value; return new ImmutableTracePointRequest( this.serverRollup, this.from, this.to, this.responseTimeMillisLow, this.responseTimeMillisHigh, this.transactionType, this.transactionNameComparator, this.transactionName, this.headlineComparator, this.headline, this.errorComparator, this.error, this.userComparator, this.user, this.attributeName, this.attributeValueComparator, this.attributeValue, this.slowOnly, this.errorOnly, newValue); } /** * This instance is equal to instances of {@code ImmutableTracePointRequest} 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 ImmutableTracePointRequest && equalTo((ImmutableTracePointRequest) another); } private boolean equalTo(ImmutableTracePointRequest another) { return serverRollup.equals(another.serverRollup) && from == another.from && to == another.to && Double.doubleToLongBits(responseTimeMillisLow) == Double.doubleToLongBits(another.responseTimeMillisLow) && Objects.equal(responseTimeMillisHigh, another.responseTimeMillisHigh) && Objects.equal(transactionType, another.transactionType) && Objects.equal(transactionNameComparator, another.transactionNameComparator) && Objects.equal(transactionName, another.transactionName) && Objects.equal(headlineComparator, another.headlineComparator) && Objects.equal(headline, another.headline) && Objects.equal(errorComparator, another.errorComparator) && Objects.equal(error, another.error) && Objects.equal(userComparator, another.userComparator) && Objects.equal(user, another.user) && Objects.equal(attributeName, another.attributeName) && Objects.equal(attributeValueComparator, another.attributeValueComparator) && Objects.equal(attributeValue, another.attributeValue) && slowOnly == another.slowOnly && errorOnly == another.errorOnly && limit == another.limit; } /** * Computes hash code from attributes: {@code serverRollup}, {@code from}, {@code to}, {@code responseTimeMillisLow}, {@code responseTimeMillisHigh}, {@code transactionType}, {@code transactionNameComparator}, {@code transactionName}, {@code headlineComparator}, {@code headline}, {@code errorComparator}, {@code error}, {@code userComparator}, {@code user}, {@code attributeName}, {@code attributeValueComparator}, {@code attributeValue}, {@code slowOnly}, {@code errorOnly}, {@code limit}. * @return hashCode value */ @Override public int hashCode() { int h = 31; h = h * 17 + serverRollup.hashCode(); h = h * 17 + Longs.hashCode(from); h = h * 17 + Longs.hashCode(to); h = h * 17 + Doubles.hashCode(responseTimeMillisLow); h = h * 17 + Objects.hashCode(responseTimeMillisHigh); h = h * 17 + Objects.hashCode(transactionType); h = h * 17 + Objects.hashCode(transactionNameComparator); h = h * 17 + Objects.hashCode(transactionName); h = h * 17 + Objects.hashCode(headlineComparator); h = h * 17 + Objects.hashCode(headline); h = h * 17 + Objects.hashCode(errorComparator); h = h * 17 + Objects.hashCode(error); h = h * 17 + Objects.hashCode(userComparator); h = h * 17 + Objects.hashCode(user); h = h * 17 + Objects.hashCode(attributeName); h = h * 17 + Objects.hashCode(attributeValueComparator); h = h * 17 + Objects.hashCode(attributeValue); h = h * 17 + Booleans.hashCode(slowOnly); h = h * 17 + Booleans.hashCode(errorOnly); h = h * 17 + limit; return h; } /** * Prints immutable value {@code TracePointRequest...} with attribute values, * excluding any non-generated and auxiliary attributes. * @return string representation of value */ @Override public String toString() { return MoreObjects.toStringHelper("TracePointRequest") .add("serverRollup", serverRollup) .add("from", from) .add("to", to) .add("responseTimeMillisLow", responseTimeMillisLow) .add("responseTimeMillisHigh", responseTimeMillisHigh) .add("transactionType", transactionType) .add("transactionNameComparator", transactionNameComparator) .add("transactionName", transactionName) .add("headlineComparator", headlineComparator) .add("headline", headline) .add("errorComparator", errorComparator) .add("error", error) .add("userComparator", userComparator) .add("user", user) .add("attributeName", attributeName) .add("attributeValueComparator", attributeValueComparator) .add("attributeValue", attributeValue) .add("slowOnly", slowOnly) .add("errorOnly", errorOnly) .add("limit", limit) .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 serverRollup; @JsonProperty @Nullable Long from; @JsonProperty @Nullable Long to; @JsonProperty @Nullable java.lang.Double responseTimeMillisLow; @JsonProperty @Nullable java.lang.Double responseTimeMillisHigh; @JsonProperty @Nullable String transactionType; @JsonProperty @Nullable StringComparator transactionNameComparator; @JsonProperty @Nullable String transactionName; @JsonProperty @Nullable StringComparator headlineComparator; @JsonProperty @Nullable String headline; @JsonProperty @Nullable StringComparator errorComparator; @JsonProperty @Nullable String error; @JsonProperty @Nullable StringComparator userComparator; @JsonProperty @Nullable String user; @JsonProperty @Nullable String attributeName; @JsonProperty @Nullable StringComparator attributeValueComparator; @JsonProperty @Nullable String attributeValue; @JsonProperty @Nullable Boolean slowOnly; @JsonProperty @Nullable Boolean errorOnly; @JsonProperty @Nullable Integer limit; } /** * @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 ImmutableTracePointRequest fromJson(Json json) { ImmutableTracePointRequest.Builder builder = ImmutableTracePointRequest.builder(); if (json.serverRollup != null) { builder.serverRollup(json.serverRollup); } if (json.from != null) { builder.from(json.from); } if (json.to != null) { builder.to(json.to); } if (json.responseTimeMillisLow != null) { builder.responseTimeMillisLow(json.responseTimeMillisLow); } if (json.responseTimeMillisHigh != null) { builder.responseTimeMillisHigh(json.responseTimeMillisHigh); } if (json.transactionType != null) { builder.transactionType(json.transactionType); } if (json.transactionNameComparator != null) { builder.transactionNameComparator(json.transactionNameComparator); } if (json.transactionName != null) { builder.transactionName(json.transactionName); } if (json.headlineComparator != null) { builder.headlineComparator(json.headlineComparator); } if (json.headline != null) { builder.headline(json.headline); } if (json.errorComparator != null) { builder.errorComparator(json.errorComparator); } if (json.error != null) { builder.error(json.error); } if (json.userComparator != null) { builder.userComparator(json.userComparator); } if (json.user != null) { builder.user(json.user); } if (json.attributeName != null) { builder.attributeName(json.attributeName); } if (json.attributeValueComparator != null) { builder.attributeValueComparator(json.attributeValueComparator); } if (json.attributeValue != null) { builder.attributeValue(json.attributeValue); } if (json.slowOnly != null) { builder.slowOnly(json.slowOnly); } if (json.errorOnly != null) { builder.errorOnly(json.errorOnly); } if (json.limit != null) { builder.limit(json.limit); } return builder.build(); } /** * Creates immutable copy of {@link TracePointJsonService.TracePointRequest}. * 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 TracePointRequest instance */ public static ImmutableTracePointRequest copyOf(TracePointJsonService.TracePointRequest instance) { if (instance instanceof ImmutableTracePointRequest) { return (ImmutableTracePointRequest) instance; } return ImmutableTracePointRequest.builder() .copyFrom(instance) .build(); } /** * Creates builder for {@link org.glowroot.ui.ImmutableTracePointRequest ImmutableTracePointRequest}. * @return new ImmutableTracePointRequest builder */ public static ImmutableTracePointRequest.Builder builder() { return new ImmutableTracePointRequest.Builder(); } /** * Builds instances of {@link org.glowroot.ui.ImmutableTracePointRequest ImmutableTracePointRequest}. * 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 public static final class Builder { private static final long INIT_BIT_SERVER_ROLLUP = 0x1L; private static final long INIT_BIT_FROM = 0x2L; private static final long INIT_BIT_TO = 0x4L; private static final long INIT_BIT_RESPONSE_TIME_MILLIS_LOW = 0x8L; private static final long INIT_BIT_LIMIT = 0x10L; private static final long OPT_BIT_SLOW_ONLY = 0x1L; private static final long OPT_BIT_ERROR_ONLY = 0x2L; private long initBits = 0x1f; private long optBits; private @Nullable String serverRollup; private long from; private long to; private double responseTimeMillisLow; private @Nullable java.lang.Double responseTimeMillisHigh; private @Nullable String transactionType; private @Nullable StringComparator transactionNameComparator; private @Nullable String transactionName; private @Nullable StringComparator headlineComparator; private @Nullable String headline; private @Nullable StringComparator errorComparator; private @Nullable String error; private @Nullable StringComparator userComparator; private @Nullable String user; private @Nullable String attributeName; private @Nullable StringComparator attributeValueComparator; private @Nullable String attributeValue; private boolean slowOnly; private boolean errorOnly; private int limit; private Builder() {} /** * Fill builder with attribute values from provided {@link TracePointJsonService.TracePointRequest} 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(TracePointJsonService.TracePointRequest instance) { Preconditions.checkNotNull(instance); serverRollup(instance.serverRollup()); from(instance.from()); to(instance.to()); responseTimeMillisLow(instance.responseTimeMillisLow()); @Nullable java.lang.Double responseTimeMillisHighValue = instance.responseTimeMillisHigh(); if (responseTimeMillisHighValue != null) { responseTimeMillisHigh(responseTimeMillisHighValue); } @Nullable String transactionTypeValue = instance.transactionType(); if (transactionTypeValue != null) { transactionType(transactionTypeValue); } @Nullable StringComparator transactionNameComparatorValue = instance.transactionNameComparator(); if (transactionNameComparatorValue != null) { transactionNameComparator(transactionNameComparatorValue); } @Nullable String transactionNameValue = instance.transactionName(); if (transactionNameValue != null) { transactionName(transactionNameValue); } @Nullable StringComparator headlineComparatorValue = instance.headlineComparator(); if (headlineComparatorValue != null) { headlineComparator(headlineComparatorValue); } @Nullable String headlineValue = instance.headline(); if (headlineValue != null) { headline(headlineValue); } @Nullable StringComparator errorComparatorValue = instance.errorComparator(); if (errorComparatorValue != null) { errorComparator(errorComparatorValue); } @Nullable String errorValue = instance.error(); if (errorValue != null) { error(errorValue); } @Nullable StringComparator userComparatorValue = instance.userComparator(); if (userComparatorValue != null) { userComparator(userComparatorValue); } @Nullable String userValue = instance.user(); if (userValue != null) { user(userValue); } @Nullable String attributeNameValue = instance.attributeName(); if (attributeNameValue != null) { attributeName(attributeNameValue); } @Nullable StringComparator attributeValueComparatorValue = instance.attributeValueComparator(); if (attributeValueComparatorValue != null) { attributeValueComparator(attributeValueComparatorValue); } @Nullable String attributeValueValue = instance.attributeValue(); if (attributeValueValue != null) { attributeValue(attributeValueValue); } slowOnly(instance.slowOnly()); errorOnly(instance.errorOnly()); limit(instance.limit()); return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#serverRollup() serverRollup}. * @param serverRollup value for serverRollup * @return {@code this} builder for chained invocation */ public final Builder serverRollup(String serverRollup) { this.serverRollup = Preconditions.checkNotNull(serverRollup); initBits &= ~INIT_BIT_SERVER_ROLLUP; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#from() from}. * @param from value for from * @return {@code this} builder for chained invocation */ public final Builder from(long from) { this.from = from; initBits &= ~INIT_BIT_FROM; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#to() to}. * @param to value for to * @return {@code this} builder for chained invocation */ public final Builder to(long to) { this.to = to; initBits &= ~INIT_BIT_TO; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#responseTimeMillisLow() responseTimeMillisLow}. * @param responseTimeMillisLow value for responseTimeMillisLow * @return {@code this} builder for chained invocation */ public final Builder responseTimeMillisLow(double responseTimeMillisLow) { this.responseTimeMillisLow = responseTimeMillisLow; initBits &= ~INIT_BIT_RESPONSE_TIME_MILLIS_LOW; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#responseTimeMillisHigh() responseTimeMillisHigh}. * @param responseTimeMillisHigh value for responseTimeMillisHigh, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder responseTimeMillisHigh(@Nullable java.lang.Double responseTimeMillisHigh) { this.responseTimeMillisHigh = responseTimeMillisHigh; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#transactionType() transactionType}. * @param transactionType value for transactionType, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder transactionType(@Nullable String transactionType) { this.transactionType = transactionType; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#transactionNameComparator() transactionNameComparator}. * @param transactionNameComparator value for transactionNameComparator, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder transactionNameComparator(@Nullable StringComparator transactionNameComparator) { this.transactionNameComparator = transactionNameComparator; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#transactionName() transactionName}. * @param transactionName value for transactionName, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder transactionName(@Nullable String transactionName) { this.transactionName = transactionName; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#headlineComparator() headlineComparator}. * @param headlineComparator value for headlineComparator, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder headlineComparator(@Nullable StringComparator headlineComparator) { this.headlineComparator = headlineComparator; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#headline() headline}. * @param headline value for headline, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder headline(@Nullable String headline) { this.headline = headline; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#errorComparator() errorComparator}. * @param errorComparator value for errorComparator, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder errorComparator(@Nullable StringComparator errorComparator) { this.errorComparator = errorComparator; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#error() error}. * @param error value for error, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder error(@Nullable String error) { this.error = error; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#userComparator() userComparator}. * @param userComparator value for userComparator, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder userComparator(@Nullable StringComparator userComparator) { this.userComparator = userComparator; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#user() user}. * @param user value for user, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder user(@Nullable String user) { this.user = user; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#attributeName() attributeName}. * @param attributeName value for attributeName, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder attributeName(@Nullable String attributeName) { this.attributeName = attributeName; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#attributeValueComparator() attributeValueComparator}. * @param attributeValueComparator value for attributeValueComparator, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder attributeValueComparator(@Nullable StringComparator attributeValueComparator) { this.attributeValueComparator = attributeValueComparator; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#attributeValue() attributeValue}. * @param attributeValue value for attributeValue, can be {@code null} * @return {@code this} builder for chained invocation */ public final Builder attributeValue(@Nullable String attributeValue) { this.attributeValue = attributeValue; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#slowOnly() slowOnly}. *

If not set, this attribute will have default value returned by initializer of {@link TracePointJsonService.TracePointRequest#slowOnly() slowOnly}. * @param slowOnly value for slowOnly * @return {@code this} builder for chained invocation */ public final Builder slowOnly(boolean slowOnly) { this.slowOnly = slowOnly; optBits |= OPT_BIT_SLOW_ONLY; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#errorOnly() errorOnly}. *

If not set, this attribute will have default value returned by initializer of {@link TracePointJsonService.TracePointRequest#errorOnly() errorOnly}. * @param errorOnly value for errorOnly * @return {@code this} builder for chained invocation */ public final Builder errorOnly(boolean errorOnly) { this.errorOnly = errorOnly; optBits |= OPT_BIT_ERROR_ONLY; return this; } /** * Initializes value for {@link TracePointJsonService.TracePointRequest#limit() limit}. * @param limit value for limit * @return {@code this} builder for chained invocation */ public final Builder limit(int limit) { this.limit = limit; initBits &= ~INIT_BIT_LIMIT; return this; } /** * Builds new {@link org.glowroot.ui.ImmutableTracePointRequest ImmutableTracePointRequest}. * @return immutable instance of TracePointRequest * @throws exception {@code java.lang.IllegalStateException} if any required attributes are missing */ public ImmutableTracePointRequest build() throws IllegalStateException { checkRequiredAttributes(); return new ImmutableTracePointRequest(this); } private boolean slowOnlyIsSet() { return (optBits & OPT_BIT_SLOW_ONLY) != 0; } private boolean errorOnlyIsSet() { return (optBits & OPT_BIT_ERROR_ONLY) != 0; } private boolean serverRollupIsSet() { return (initBits & INIT_BIT_SERVER_ROLLUP) == 0; } private boolean fromIsSet() { return (initBits & INIT_BIT_FROM) == 0; } private boolean toIsSet() { return (initBits & INIT_BIT_TO) == 0; } private boolean responseTimeMillisLowIsSet() { return (initBits & INIT_BIT_RESPONSE_TIME_MILLIS_LOW) == 0; } private boolean limitIsSet() { return (initBits & INIT_BIT_LIMIT) == 0; } private void checkRequiredAttributes() throws IllegalStateException { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } } private String formatRequiredAttributesMessage() { List attributes = Lists.newArrayList(); if (!serverRollupIsSet()) attributes.add("serverRollup"); if (!fromIsSet()) attributes.add("from"); if (!toIsSet()) attributes.add("to"); if (!responseTimeMillisLowIsSet()) attributes.add("responseTimeMillisLow"); if (!limitIsSet()) attributes.add("limit"); return "Cannot build TracePointRequest, some of required attributes are not set " + attributes; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy