Class PointBuilder


  • public final class PointBuilder
    extends Object
    Single-use builder for the immutable Point instances used to set dimensions for a metric. Get a fresh instance either from a corresponding Gauge or Counter, or through the MetricReceiver API.
    Author:
    steinar
    • Method Detail

      • set

        public PointBuilder set​(String dimensionName,
                                long dimensionValue)
        Set a named dimension to an integer value.
        Parameters:
        dimensionName - the name of the dimension to set
        dimensionValue - to value for the given dimension
        Returns:
        this, to facilitate chaining
      • set

        public PointBuilder set​(String dimensionName,
                                double dimensionValue)
        Set a named dimension to a floating point value.
        Parameters:
        dimensionName - the name of the dimension to set
        dimensionValue - to value for the given dimension
        Returns:
        this, to facilitate chaining
      • set

        public PointBuilder set​(String dimensionName,
                                String dimensionValue)
        Set a named dimension to a string value.
        Parameters:
        dimensionName - the name of the dimension to set
        dimensionValue - to value for the given dimension
        Returns:
        this, to facilitate chaining
      • build

        public Point build()
        Create a new Point instance using the settings stored in this PointBuilder. PointBuilder instances cannot be re-used after build() has been invoked.
        Returns:
        a Point instance reflecting this builder