Record Class CohesionValue
java.lang.Object
java.lang.Record
dev.archunitjava.metrics.CohesionValue
- All Implemented Interfaces:
Comparable<CohesionValue>
public record CohesionValue(TypeId subject, LcomVariant variant, MetricAvailability availability, Optional<MetricAmount> amount, int methodCount, int fieldCount, String explanation)
extends Record
implements Comparable<CohesionValue>
One LCOM result with explicit evidence availability and formula population.
-
Constructor Summary
ConstructorsConstructorDescriptionCohesionValue(TypeId subject, LcomVariant variant, MetricAvailability availability, Optional<MetricAmount> amount, int methodCount, int fieldCount, String explanation) Creates an instance of aCohesionValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionamount()Returns the value of theamountrecord component.Returns the value of theavailabilityrecord component.intcompareTo(CohesionValue other) final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexplanationrecord component.intReturns the value of thefieldCountrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themethodCountrecord component.sample()subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.variant()Returns the value of thevariantrecord component.
-
Constructor Details
-
CohesionValue
public CohesionValue(TypeId subject, LcomVariant variant, MetricAvailability availability, Optional<MetricAmount> amount, int methodCount, int fieldCount, String explanation) Creates an instance of aCohesionValuerecord class.- Parameters:
subject- the value for thesubjectrecord componentvariant- the value for thevariantrecord componentavailability- the value for theavailabilityrecord componentamount- the value for theamountrecord componentmethodCount- the value for themethodCountrecord componentfieldCount- the value for thefieldCountrecord componentexplanation- the value for theexplanationrecord component
-
-
Method Details
-
sample
-
compareTo
- Specified by:
compareToin interfaceComparable<CohesionValue>
-
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. -
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
variant
Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-
availability
Returns the value of theavailabilityrecord component.- Returns:
- the value of the
availabilityrecord component
-
amount
Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-
methodCount
public int methodCount()Returns the value of themethodCountrecord component.- Returns:
- the value of the
methodCountrecord component
-
fieldCount
public int fieldCount()Returns the value of thefieldCountrecord component.- Returns:
- the value of the
fieldCountrecord component
-
explanation
Returns the value of theexplanationrecord component.- Returns:
- the value of the
explanationrecord component
-