Class HelidonMetadata

  • All Implemented Interfaces:
    Metadata

    public class HelidonMetadata
    extends DefaultMetadata
    Class HelidonMetadata. In MP Metrics 2.0, Metadata is now immutable and a builder was added. This class allows creation of metadata directly using a constructor to avoid switching to a builder in dozens of locations. Can be used from other packages unfortunately.
    • Constructor Detail

      • HelidonMetadata

        public HelidonMetadata​(String name,
                               MetricType type)
        Construct immutable metadata.
        Parameters:
        name - Metric name.
        type - Metric type.
      • HelidonMetadata

        public HelidonMetadata​(String name,
                               String displayName,
                               String description,
                               MetricType type,
                               String unit,
                               boolean reusable)
        Construct immutable metadata.
        Parameters:
        name - Metric name.
        displayName - Metric display name.
        description - Metric description.
        type - Metric type.
        unit - Metric unit.
        reusable - Reusable flag.
      • HelidonMetadata

        public HelidonMetadata​(String name,
                               String displayName,
                               String description,
                               MetricType type,
                               String unit)
        Construct immutable metadata.
        Parameters:
        name - Metric name.
        displayName - Metric display name.
        description - Metric description.
        type - Metric type.
        unit - Metric unit.
    • Method Detail

      • newFlexible

        public static HelidonMetadata newFlexible​(String name,
                                                  String displayName,
                                                  String description,
                                                  MetricType type,
                                                  String unit)
        Creates a new "flexible" metadata instance which, when used in comparison against other instances, will require matches on only the name and type. This is particularly useful for injection handling of @Metric which can specify metadata-related information to be used if the metadata has not been previously registered but need not mandate what that existing metadata must be.
        Parameters:
        name - name
        displayName - display name
        description - description
        type - metric type
        unit - unit
        Returns:
        new flexible HelidonMetadata
      • isFlexible

        public boolean isFlexible()