Interface Metric.Builder<M extends Metric>

Enclosing interface:
Metric

public static interface Metric.Builder<M extends Metric>
Represents a builder for metric objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds the metric based on the properties given to this builder.
    withDescription(String description)
    Returns this Builder with the given description of the metric being built.
    withTag(String name, String value)
    Returns this Builder with the given tag added to the list of tags of the metric being built.
    default Metric.Builder<M>
    Returns this Builder with the given tags added to the list of tags of the metric being built.
  • Method Details

    • withDescription

      Metric.Builder<M> withDescription(String description)
      Returns this Builder with the given description of the metric being built.
      Parameters:
      description - Description of the metric
      Returns:
      The builder with added description
    • withTag

      Metric.Builder<M> withTag(String name, String value)
      Returns this Builder with the given tag added to the list of tags of the metric being built.
      Parameters:
      name - Tag key
      value - Tag value
      Returns:
      The builder with added tag
    • withTags

      default Metric.Builder<M> withTags(Map<String,String> tags)
      Returns this Builder with the given tags added to the list of tags of the metric being built.
      Parameters:
      tags - a map of tag keys and values
      Returns:
      The builder with added tags
    • build

      M build()
      Builds the metric based on the properties given to this builder.
      Returns:
      Ready-to-use metric