Package io.helidon.metrics
Class HelidonMetadata
- java.lang.Object
-
- org.eclipse.microprofile.metrics.DefaultMetadata
-
- io.helidon.metrics.HelidonMetadata
-
- All Implemented Interfaces:
Metadata
public class HelidonMetadata extends DefaultMetadata
Class HelidonMetadata. In MP Metrics 2.0,Metadatais 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 Summary
Constructors Constructor Description HelidonMetadata(String name, String displayName, String description, MetricType type, String unit)Construct immutable metadata.HelidonMetadata(String name, String displayName, String description, MetricType type, String unit, boolean reusable)Construct immutable metadata.HelidonMetadata(String name, MetricType type)Construct immutable metadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()booleanisFlexible()static HelidonMetadatanewFlexible(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.StringtoString()-
Methods inherited from class org.eclipse.microprofile.metrics.DefaultMetadata
getDescription, getDisplayName, getName, getType, getTypeRaw, getUnit, isReusable
-
-
-
-
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@Metricwhich 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- namedisplayName- display namedescription- descriptiontype- metric typeunit- unit- Returns:
- new flexible
HelidonMetadata
-
isFlexible
public boolean isFlexible()
-
toString
public String toString()
- Overrides:
toStringin classDefaultMetadata
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultMetadata
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classDefaultMetadata
-
-