com.h3c.sdn.metric

## Class TimerDescriptor.TimerDescriptorBuilder

- java.lang.Object
- - com.h3c.sdn.metric.MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>
  - - com.h3c.sdn.metric.TimerDescriptor.TimerDescriptorBuilder

- Enclosing class:
    TimerDescriptor

      public static class TimerDescriptor.TimerDescriptorBuilder
      extends MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>

  Timer descriptor builder object, which requires that only arguments that are mandatory for the construction of a `TimerDescriptor` be specified during its own construction. Values may also be specified for the optional arguments needed for a `TimerDescriptor`, but these values are defaulted in the event that no value is specified for them.

- - ### Field Summary

    - ### Fields inherited from class com.h3c.sdn.metric.MetricDescriptor.MetricDescriptorBuilder

      `appId, description, jmx, name, persist, primaryTag, secondaryTag, summaryMinutes, type`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimerDescriptor.TimerDescriptorBuilder(String name)` Creates a new `TimerDescriptor.TimerDescriptorBuilder` using only the arguments that are required to build a valid `TimerDescriptor`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TimerDescriptor.TimerDescriptorBuilder` | `appId(String toSet)` Sets the application ID to apply to the `MetricDescriptor` that will be built.
    `TimerDescriptor` | `build()` Build a `TimerDescriptor` instance.
    `TimerDescriptor.TimerDescriptorBuilder` | `description(String toSet)` Sets the description to apply to the `MetricDescriptor` that will be built.
    `TimerDescriptor.TimerDescriptorBuilder` | `name(String toSet)` Sets the name to apply to the `MetricDescriptor` that will be built.
    `TimerDescriptor.TimerDescriptorBuilder` | `persist(boolean toSet)` Sets the flag that indicates whether the `MetricDescriptor` that will be built is to be persisted.
    `TimerDescriptor.TimerDescriptorBuilder` | `primaryTag(String toSet)` Sets the primary tag (e.g.
    `TimerDescriptor.TimerDescriptorBuilder` | `publishToJmx(boolean toSet)` Sets the flag that indicates whether the `MetricDescriptor` that will be built should be made visible via JMX.
    `TimerDescriptor.TimerDescriptorBuilder` | `secondaryTag(String toSet)` Sets the secondary tag (e.g.
    `TimerDescriptor.TimerDescriptorBuilder` | `summaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)` Sets the number of minutes that should elapse between the persistence of summarized values to apply to the `MetricDescriptor` that will be built.
    `TimerDescriptor.TimerDescriptorBuilder` | `type(MetricDescriptor.Type toSet)` Sets the metric type to apply to the `MetricDescriptor` that will be built.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TimerDescriptor.TimerDescriptorBuilder

          public TimerDescriptor.TimerDescriptorBuilder(String name)

      Creates a new `TimerDescriptor.TimerDescriptorBuilder` using only the arguments that are required to build a valid `TimerDescriptor`. If no other fields are set via other methods before building, the resulting `TimerDescriptor` will specify a `TimeStampedTimer` associated with no specific application, no primary or secondary tags, no description, and that the resulting `TimeStampedTimer` should be persisted using the default summarization interval and should not be visible via JMX.
      Parameters:
        `name` - a name for the `TimeStampedTimer` (e.g. "txPacketQueue")

  - ### Method Detail

    - #### build

          public TimerDescriptor build()

      Build a `TimerDescriptor` instance.
      Specified by:
        `build` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Returns:
        the resulting `TimerDescriptor`

    - #### appId

          public TimerDescriptor.TimerDescriptorBuilder appId(String toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the application ID to apply to the `MetricDescriptor` that will be built.
      Overrides:
        `appId` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - application ID
      Returns:
        self

    - #### description

          public TimerDescriptor.TimerDescriptorBuilder description(String toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the description to apply to the `MetricDescriptor` that will be built.
      Overrides:
        `description` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - description
      Returns:
        self

    - #### name

          public TimerDescriptor.TimerDescriptorBuilder name(String toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the name to apply to the `MetricDescriptor` that will be built. Many metrics may have the same name (e.g. "txPackets") but can be distinguished from one another via the primary and secondary tags specified.
      Overrides:
        `name` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - name
      Returns:
        self

    - #### persist

          public TimerDescriptor.TimerDescriptorBuilder persist(boolean toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the flag that indicates whether the `MetricDescriptor` that will be built is to be persisted. `true` indicates that the value should be persisted, `false` that it shouldn't.
      Overrides:
        `persist` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - persistence flag
      Returns:
        self

    - #### primaryTag

          public TimerDescriptor.TimerDescriptorBuilder primaryTag(String toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the primary tag (e.g. "router-1.2.3.4") to apply to the `MetricDescriptor` that will be built. The tag can be anything that is a useful identifier to group metrics by.
      Overrides:
        `primaryTag` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - primary tag
      Returns:
        self

    - #### publishToJmx

          public TimerDescriptor.TimerDescriptorBuilder publishToJmx(boolean toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the flag that indicates whether the `MetricDescriptor` that will be built should be made visible via JMX. `true` indicates that the value should be visible, `false` that it shouldn't.
      Overrides:
        `publishToJmx` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - JMX flag
      Returns:
        self

    - #### secondaryTag

          public TimerDescriptor.TimerDescriptorBuilder secondaryTag(String toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the secondary tag (e.g. "port1") to apply to the `MetricDescriptor` that will be built. The tag can be anything that is a useful identifier to group metrics by, but should make sense in the context of the specified primary tag.
      Overrides:
        `secondaryTag` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - secondary tag
      Returns:
        self

    - #### summaryMinutes

          public TimerDescriptor.TimerDescriptorBuilder summaryMinutes(MetricDescriptor.SummaryIntervalMinutes toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the number of minutes that should elapse between the persistence of summarized values to apply to the `MetricDescriptor` that will be built.
      Overrides:
        `summaryMinutes` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - summarization interval (in minutes)
      Returns:
        self

    - #### type

          public TimerDescriptor.TimerDescriptorBuilder type(MetricDescriptor.Type toSet)

      Description copied from class: `MetricDescriptor.MetricDescriptorBuilder`
      Sets the metric type to apply to the `MetricDescriptor` that will be built.
      Overrides:
        `type` in class `MetricDescriptor.MetricDescriptorBuilder<TimerDescriptor>`
      Parameters:
        `toSet` - metric type
      Returns:
        self

Copyright © 2014. All Rights Reserved.