Class SimpleCollector.Builder<B extends SimpleCollector.Builder<B,​C>,​C extends SimpleCollector>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean dontInitializeNoLabelsChild  
      (package private) java.lang.String fullname  
      (package private) java.lang.String help  
      (package private) java.lang.String[] labelNames  
      (package private) java.lang.String name  
      (package private) java.lang.String namespace  
      (package private) java.lang.String subsystem  
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract C create()
      Return the constructed collector.
      B help​(java.lang.String help)
      Set the help string of the metric.
      B labelNames​(java.lang.String... labelNames)
      Set the labelNames of the metric.
      B name​(java.lang.String name)
      Set the name of the metric.
      B namespace​(java.lang.String namespace)
      Set the namespace of the metric.
      C register()
      Create and register the Collector with the default registry.
      C register​(CollectorRegistry registry)
      Create and register the Collector with the given registry.
      B subsystem​(java.lang.String subsystem)
      Set the subsystem of the metric.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • namespace

        java.lang.String namespace
      • subsystem

        java.lang.String subsystem
      • name

        java.lang.String name
      • fullname

        java.lang.String fullname
      • help

        java.lang.String help
      • labelNames

        java.lang.String[] labelNames
      • dontInitializeNoLabelsChild

        boolean dontInitializeNoLabelsChild
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • name

        public B name​(java.lang.String name)
        Set the name of the metric. Required.
      • subsystem

        public B subsystem​(java.lang.String subsystem)
        Set the subsystem of the metric. Optional.
      • namespace

        public B namespace​(java.lang.String namespace)
        Set the namespace of the metric. Optional.
      • help

        public B help​(java.lang.String help)
        Set the help string of the metric. Required.
      • labelNames

        public B labelNames​(java.lang.String... labelNames)
        Set the labelNames of the metric. Optional, defaults to no labels.
      • create

        public abstract C create()
        Return the constructed collector.

        Abstract due to generics limitations.

      • register

        public C register()
        Create and register the Collector with the default registry.
      • register

        public C register​(CollectorRegistry registry)
        Create and register the Collector with the given registry.