Record Class Tag
java.lang.Object
java.lang.Record
cloud.opencode.base.observability.metric.Tag
- Record Components:
key- the tag key, must not be null or blank | 标签键,不能为 null 或空白value- the tag value, must not be null | 标签值,不能为 null
Tag - A key-value pair for metric dimensioning
Tag - 用于指标维度化的键值对
Tags provide dimensional metadata to metrics, enabling filtering and grouping in monitoring systems. Keys must be non-blank; values must be non-null.
标签为指标提供维度元数据,支持监控系统中的过滤和分组。 键不能为空白;值不能为 null。
- 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.key()Returns the value of thekeyrecord component.static TagCreates a new Tag with the given key and value.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Tag
-
-
Method Details
-
of
Creates a new Tag with the given key and value. 使用给定的键和值创建新标签。- Parameters:
key- the tag key | 标签键value- the tag value | 标签值- Returns:
- a new Tag instance | 新的 Tag 实例
- Throws:
ObservabilityException- if key is null/blank or value is null | 如果键为 null/空白或值为 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). -
key
-
value
-