Class PointBuilder


  • @Beta
    public final class PointBuilder
    extends java.lang.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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Point build()
      Create a new Point instance using the settings stored in this PointBuilder.
      PointBuilder set​(java.lang.String dimensionName, double dimensionValue)
      Set a named dimension to a floating point value.
      PointBuilder set​(java.lang.String dimensionName, long dimensionValue)
      Set a named dimension to an integer value.
      PointBuilder set​(java.lang.String dimensionName, java.lang.String dimensionValue)
      Set a named dimension to a string value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • set

        public PointBuilder set​(java.lang.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​(java.lang.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​(java.lang.String dimensionName,
                                java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object