Class MeasurementContext.Builder
java.lang.Object
dk.cloudcreate.essentials.shared.measurement.MeasurementContext.Builder
- Enclosing class:
- MeasurementContext
Builder for creating instances of
MeasurementContext.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theMeasurementContextinstance.description(String description) Sets the description for the measurement.optionalTag(String key, String value) Adds an optional tag to the measurement.Adds a tag to the measurement.tag(String key, CharSequence value) Adds a tag to the measurement.Adds a tag to the measurement.
-
Constructor Details
-
Builder
Creates a new Builder with the given metric name.- Parameters:
metricName- the metric name
-
-
Method Details
-
description
Sets the description for the measurement.- Parameters:
description- the description text- Returns:
- the builder instance
-
tag
Adds a tag to the measurement.- Parameters:
key- the tag keyvalue- the tag value- Returns:
- the builder instance
-
tag
Adds a tag to the measurement.- Parameters:
key- the tag keyvalue- the tag value- Returns:
- the builder instance
-
optionalTag
Adds an optional tag to the measurement. If the value is null then the tag isn't added- Parameters:
key- the tag keyvalue- the tag value- Returns:
- the builder instance
-
tag
Adds a tag to the measurement.- Parameters:
key- the tag keyvalue- the tag value- Returns:
- the builder instance
-
build
Builds theMeasurementContextinstance.- Returns:
- the immutable MeasurementContext
-