Interface Meter.Builder<B extends Meter.Builder<B,M>, M extends Meter>

Type Parameters:
B - type of the builder
M - type of the meter the builder creates
All Superinterfaces:
Wrapper, Wrapper
All Known Subinterfaces:
Counter.Builder, DistributionSummary.Builder, FunctionalCounter.Builder<T>, Gauge.Builder<N>, Timer.Builder
Enclosing interface:
Meter

public static interface Meter.Builder<B extends Meter.Builder<B,M>, M extends Meter> extends Wrapper
Common behavior of specific meter builders.

This builder does not extend the conventional Helidon builder because, typically, "building" a meter involves registering it which is implementation-specific and therefore should be performed only by each implementation. We do not want developers to see a build() operation that they should not invoke.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    addTag(Tag tag)
    Adds a single tag to the builder's collection.
    Returns the base unit the builder will use.
    baseUnit(String baseUnit)
    Sets the units.
    Returns the description the builder will use.
    description(String description)
    Sets the description.
    default B
    Returns the type-correct "this".
    Returns the name the builder will use.
    default Optional<String>
    Returns the fully-qualified name of the type which originated the meter, if set.
    default B
    origin(String origin)
    Sets the fully-qualified name of the type which originated the meter.
    default Optional<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Core metrics does not assign scopes, and this method will be removed.
    default B
    scope(String scope)
    Deprecated, for removal: This API element is subject to removal in a future version.
    No-op, will be removed.
    Returns the tags the builder will use.
    tags(Iterable<Tag> tags)
    Sets the tags to use in identifying the build meter.

    Methods inherited from interface Wrapper

    unwrap
    Modifier and Type
    Method
    Description
    <T> T
    unwrap(Class<? extends T> type)
    Unwraps the delegate as the specified type.
  • Method Details

    • identity

      default B identity()
      Returns the type-correct "this".
      Returns:
      properly-typed builder itself
    • tags

      B tags(Iterable<Tag> tags)
      Sets the tags to use in identifying the build meter.
      Parameters:
      tags - Tag instances to identify the meter
      Returns:
      updated builder
    • addTag

      B addTag(Tag tag)
      Adds a single tag to the builder's collection.
      Parameters:
      tag - the tag to add
      Returns:
      updated builder
    • description

      B description(String description)
      Sets the description.
      Parameters:
      description - meter description
      Returns:
      updated builder
    • baseUnit

      B baseUnit(String baseUnit)
      Sets the units.
      Parameters:
      baseUnit - meter unit
      Returns:
      updated builder
    • scope

      @Deprecated(forRemoval=true, since="27.0.0") default B scope(String scope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No-op, will be removed.
      No-op, will be removed.
      Parameters:
      scope - ignored; must not be null
      Returns:
      updated builder
    • origin

      default B origin(String origin)
      Sets the fully-qualified name of the type which originated the meter. The origin is context for meter builder customization; it is not part of the meter identity or output.

      The default implementation validates but does not retain the origin for compatibility with existing builder implementations.

      Parameters:
      origin - fully-qualified name of the type which originated the meter
      Returns:
      updated builder
      Since:
      27.0.0
    • name

      String name()
      Returns the name the builder will use.
      Returns:
      name
    • tags

      Map<String,String> tags()
      Returns the tags the builder will use.
      Returns:
      tags
    • description

      Optional<String> description()
      Returns the description the builder will use.
      Returns:
      description if set; empty otherwise
    • baseUnit

      Optional<String> baseUnit()
      Returns the base unit the builder will use.
      Returns:
      base unit if set; empty otherwise
    • origin

      default Optional<String> origin()
      Returns the fully-qualified name of the type which originated the meter, if set.

      The origin is customization context and is not part of the meter identity or output. The default implementation returns empty for compatibility with existing builder implementations.

      Returns:
      originating type name, if set
      Since:
      27.0.0
    • scope

      @Deprecated(forRemoval=true, since="27.0.0") default Optional<String> scope()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics does not assign scopes, and this method will be removed.
      Always returns empty because core metrics does not assign scopes.
      Returns:
      empty