Package org.eclipse.microprofile.metrics
Class DefaultMetadata
- java.lang.Object
-
- org.eclipse.microprofile.metrics.DefaultMetadata
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultMetadata(java.lang.String name, java.lang.String displayName, java.lang.String description, MetricType type, java.lang.String unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
description()
java.util.Optional<java.lang.String>
displayName()
boolean
equals(java.lang.Object o)
java.lang.String
getDescription()
Returns the description of the metric if set, otherwise this method returns the emptyString
.java.lang.String
getDisplayName()
Returns the display name if set, otherwise this method returns the metric name.java.lang.String
getName()
Returns the metric name.java.lang.String
getType()
Returns the String representation of theMetricType
.MetricType
getTypeRaw()
Returns theMetricType
of the metric if set, otherwise it returnsMetricType.INVALID
java.lang.String
getUnit()
Returns the unit of this metric if set, otherwise this method returnsMetricUnits.NONE
int
hashCode()
java.lang.String
toString()
java.util.Optional<java.lang.String>
unit()
-
-
-
Constructor Detail
-
DefaultMetadata
protected DefaultMetadata(java.lang.String name, java.lang.String displayName, java.lang.String description, MetricType type, java.lang.String unit)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Metadata
Returns the metric name.
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:Metadata
Returns the display name if set, otherwise this method returns the metric name.- Specified by:
getDisplayName
in interfaceMetadata
- Returns:
- the display name
-
displayName
public java.util.Optional<java.lang.String> displayName()
- Specified by:
displayName
in interfaceMetadata
-
getDescription
public java.lang.String getDescription()
Description copied from interface:Metadata
Returns the description of the metric if set, otherwise this method returns the emptyString
.- Specified by:
getDescription
in interfaceMetadata
- Returns:
- the description
-
description
public java.util.Optional<java.lang.String> description()
- Specified by:
description
in interfaceMetadata
-
getType
public java.lang.String getType()
Description copied from interface:Metadata
Returns the String representation of theMetricType
.- Specified by:
getType
in interfaceMetadata
- Returns:
- the MetricType as a String
- See Also:
MetricType
-
getTypeRaw
public MetricType getTypeRaw()
Description copied from interface:Metadata
Returns theMetricType
of the metric if set, otherwise it returnsMetricType.INVALID
- Specified by:
getTypeRaw
in interfaceMetadata
- Returns:
- the
MetricType
-
getUnit
public java.lang.String getUnit()
Description copied from interface:Metadata
Returns the unit of this metric if set, otherwise this method returnsMetricUnits.NONE
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-