Record Class MetricId
java.lang.Object
java.lang.Record
cloud.opencode.base.observability.metric.MetricId
- Record Components:
name- the metric name, must not be null or blank | 指标名称,不能为 null 或空白- the immutable sorted list of tags | 不可变的排序标签列表
MetricId - Unique identifier for a metric, composed of name and tags
MetricId - 指标的唯一标识符,由名称和标签组成
Tags are defensively copied and sorted by key for consistent equality semantics. Two MetricIds with the same name and same tags (regardless of original order) are equal.
标签进行防御性拷贝并按键排序,以确保一致的相等性语义。 具有相同名称和相同标签(无论原始顺序)的两个 MetricId 相等。
- Since:
- JDK 25, opencode-base-observability V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.static MetricIdCreates a MetricId with the given name and optional tags.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MetricId
-
-
Method Details
-
of
Creates a MetricId with the given name and optional tags. 使用给定名称和可选标签创建 MetricId。- Parameters:
name- the metric name | 指标名称tags- the tags | 标签- Returns:
- a new MetricId instance | 新的 MetricId 实例
- Throws:
ObservabilityException- if name is null or blank | 如果名称为 null 或空白
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
-
tags
-