Class ImmutableTelemetry.Builder
java.lang.Object
org.kiwiproject.consul.model.agent.ImmutableTelemetry.Builder
- Enclosing class:
- ImmutableTelemetry
Builds instances of type
ImmutableTelemetry.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableTelemetry.disableHostname(Boolean disableHostname) Initializes the value for thedisableHostnameattribute.dogStatsdAddr(String dogStatsdAddr) Initializes the value for thedogStatsdAddrattribute.dogStatsdTags(List<String> dogStatsdTags) Initializes the optional valuedogStatsdTagsto dogStatsdTags.dogStatsdTags(Optional<? extends List<String>> dogStatsdTags) Initializes the optional valuedogStatsdTagsto dogStatsdTags.Fill a builder with attribute values from the providedTelemetryinstance.statsdAddr(String statsdAddr) Initializes the value for thestatsdAddrattribute.statsiteAddr(String statsiteAddr) Initializes the value for thestatsiteAddrattribute.statsitePrefix(String statsitePrefix) Initializes the value for thestatsitePrefixattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedTelemetryinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
statsiteAddr
Initializes the value for thestatsiteAddrattribute.- Parameters:
statsiteAddr- The value for statsiteAddr- Returns:
thisbuilder for use in a chained invocation
-
statsdAddr
Initializes the value for thestatsdAddrattribute.- Parameters:
statsdAddr- The value for statsdAddr- Returns:
thisbuilder for use in a chained invocation
-
statsitePrefix
Initializes the value for thestatsitePrefixattribute.- Parameters:
statsitePrefix- The value for statsitePrefix- Returns:
thisbuilder for use in a chained invocation
-
disableHostname
@CanIgnoreReturnValue public final ImmutableTelemetry.Builder disableHostname(Boolean disableHostname) Initializes the value for thedisableHostnameattribute.- Parameters:
disableHostname- The value for disableHostname- Returns:
thisbuilder for use in a chained invocation
-
dogStatsdAddr
Initializes the value for thedogStatsdAddrattribute.- Parameters:
dogStatsdAddr- The value for dogStatsdAddr- Returns:
thisbuilder for use in a chained invocation
-
dogStatsdTags
@CanIgnoreReturnValue public final ImmutableTelemetry.Builder dogStatsdTags(List<String> dogStatsdTags) Initializes the optional valuedogStatsdTagsto dogStatsdTags.- Parameters:
dogStatsdTags- The value for dogStatsdTags- Returns:
thisbuilder for chained invocation
-
dogStatsdTags
@CanIgnoreReturnValue public final ImmutableTelemetry.Builder dogStatsdTags(Optional<? extends List<String>> dogStatsdTags) Initializes the optional valuedogStatsdTagsto dogStatsdTags.- Parameters:
dogStatsdTags- The value for dogStatsdTags- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableTelemetry.- Returns:
- An immutable instance of Telemetry
- Throws:
IllegalStateException- if any required attributes are missing
-