Record Class ComponentDependencyMetrics
java.lang.Object
java.lang.Record
dev.archunitjava.metrics.ComponentDependencyMetrics
- All Implemented Interfaces:
Comparable<ComponentDependencyMetrics>
public record ComponentDependencyMetrics(StableId component, int afferentCoupling, int efferentCoupling, double instability, double abstractness, double distanceFromMainSequence)
extends Record
implements Comparable<ComponentDependencyMetrics>
Robert C. Martin metrics. Couplings count distinct other components, instability is
Ce/(Ca+Ce) with 0 for no coupling, abstractness is abstract/total with 0 for no types, and
distance is |A+I-1|.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentDependencyMetrics(StableId component, int afferentCoupling, int efferentCoupling, double instability, double abstractness, double distanceFromMainSequence) Creates an instance of aComponentDependencyMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theabstractnessrecord component.intReturns the value of theafferentCouplingrecord component.intReturns the value of thecomponentrecord component.doubleReturns the value of thedistanceFromMainSequencerecord component.intReturns the value of theefferentCouplingrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinstabilityrecord component.samples()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ComponentDependencyMetrics
public ComponentDependencyMetrics(StableId component, int afferentCoupling, int efferentCoupling, double instability, double abstractness, double distanceFromMainSequence) Creates an instance of aComponentDependencyMetricsrecord class.- Parameters:
component- the value for thecomponentrecord componentafferentCoupling- the value for theafferentCouplingrecord componentefferentCoupling- the value for theefferentCouplingrecord componentinstability- the value for theinstabilityrecord componentabstractness- the value for theabstractnessrecord componentdistanceFromMainSequence- the value for thedistanceFromMainSequencerecord component
-
-
Method Details
-
samples
-
compareTo
- Specified by:
compareToin interfaceComparable<ComponentDependencyMetrics>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
component
Returns the value of thecomponentrecord component.- Returns:
- the value of the
componentrecord component
-
afferentCoupling
public int afferentCoupling()Returns the value of theafferentCouplingrecord component.- Returns:
- the value of the
afferentCouplingrecord component
-
efferentCoupling
public int efferentCoupling()Returns the value of theefferentCouplingrecord component.- Returns:
- the value of the
efferentCouplingrecord component
-
instability
public double instability()Returns the value of theinstabilityrecord component.- Returns:
- the value of the
instabilityrecord component
-
abstractness
public double abstractness()Returns the value of theabstractnessrecord component.- Returns:
- the value of the
abstractnessrecord component
-
distanceFromMainSequence
public double distanceFromMainSequence()Returns the value of thedistanceFromMainSequencerecord component.- Returns:
- the value of the
distanceFromMainSequencerecord component
-