Record Class InstrumentOptions
java.lang.Object
java.lang.Record
codes.grow.packages.otelcollector.InstrumentOptions
- Record Components:
description- instrument description, may be nullunit- UCUM unit such asms,Byor{request}, may be nullmeter- meter to create the instrument on, null forOtelCollectorMetrics.DEFAULT_METER_NAMEboundaries- explicit histogram bucket boundaries (ascending, advice to the SDK), may be empty
public record InstrumentOptions(String description, String unit, String meter, List<Double> boundaries)
extends Record
Options of the metric instrument helpers (
counter, upDownCounter,
histogram, gauge).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final InstrumentOptionsNo description, unit, meter or boundaries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theboundariesrecord component.static InstrumentOptionsboundaries(Double... boundaries) Histogram options with explicit bucket boundaries.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.meter()Returns the value of themeterrecord component.final StringtoString()Returns a string representation of this record class.unit()Returns the value of theunitrecord component.static InstrumentOptionsOptions with a unit only.withBoundaries(List<Double> boundaries) Returns a copy with histogram bucket boundaries.withDescription(String description) Returns a copy with a description.Returns a copy that creates the instrument on another meter.Returns a copy with a unit.
-
Field Details
-
NONE
No description, unit, meter or boundaries.
-
-
Constructor Details
-
InstrumentOptions
Copies the boundaries.- Parameters:
description- descriptionunit- unitmeter- meter nameboundaries- boundaries
-
-
Method Details
-
unit
Options with a unit only.- Parameters:
unit- unit- Returns:
- the options
-
boundaries
Histogram options with explicit bucket boundaries.- Parameters:
boundaries- ascending boundaries- Returns:
- the options
-
withDescription
Returns a copy with a description.- Parameters:
description- description- Returns:
- the options
-
withUnit
Returns a copy with a unit.- Parameters:
unit- unit- Returns:
- the options
-
withMeter
Returns a copy that creates the instrument on another meter.- Parameters:
meter- meter name- Returns:
- the options
-
withBoundaries
Returns a copy with histogram bucket boundaries.- Parameters:
boundaries- ascending boundaries- Returns:
- the options
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
unit
Returns the value of theunitrecord component.- Returns:
- the value of the
unitrecord component
-
meter
Returns the value of themeterrecord component.- Returns:
- the value of the
meterrecord component
-
boundaries
Returns the value of theboundariesrecord component.- Returns:
- the value of the
boundariesrecord component
-