Record Class MetricThreshold
java.lang.Object
java.lang.Record
dev.archunitjava.metrics.MetricThreshold
public record MetricThreshold(MetricName metric, MetricComparison comparison, MetricAmount limit)
extends Record
Typed inclusive threshold; construction rejects a limit expressed in the wrong unit.
-
Constructor Summary
ConstructorsConstructorDescriptionMetricThreshold(MetricName metric, MetricComparison comparison, MetricAmount limit) Creates an instance of aMetricThresholdrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricThresholdatLeast(MetricName metric, MetricAmount limit) static MetricThresholdatMost(MetricName metric, MetricAmount limit) Returns the value of thecomparisonrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.limit()Returns the value of thelimitrecord component.metric()Returns the value of themetricrecord component.final StringtoString()Returns a string representation of this record class.booleanviolatedBy(MetricSample sample)
-
Constructor Details
-
MetricThreshold
Creates an instance of aMetricThresholdrecord class.- Parameters:
metric- the value for themetricrecord componentcomparison- the value for thecomparisonrecord componentlimit- the value for thelimitrecord component
-
-
Method Details
-
atMost
-
atLeast
-
violatedBy
-
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). -
metric
Returns the value of themetricrecord component.- Returns:
- the value of the
metricrecord component
-
comparison
Returns the value of thecomparisonrecord component.- Returns:
- the value of the
comparisonrecord component
-
limit
Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-