Record Class CumulativeDependencyMetrics

java.lang.Object
java.lang.Record
dev.archunitjava.metrics.CumulativeDependencyMetrics

public record CumulativeDependencyMetrics(int componentCount, long cumulativeComponentDependency, double averageComponentDependency, double relativeAverageComponentDependency, double normalizedCumulativeComponentDependency, Map<StableId,Integer> dependsOn) extends Record
Lakos metrics. dependsOn includes the subject itself; CCD is their sum, ACD=CCD/N, RACD=ACD/N, and NCCD=CCD divided by a same-size complete-level balanced binary tree's CCD. Every value is zero for an empty projection.
  • Constructor Details

    • CumulativeDependencyMetrics

      public CumulativeDependencyMetrics(int componentCount, long cumulativeComponentDependency, double averageComponentDependency, double relativeAverageComponentDependency, double normalizedCumulativeComponentDependency, Map<StableId,Integer> dependsOn)
      Creates an instance of a CumulativeDependencyMetrics record class.
      Parameters:
      componentCount - the value for the componentCount record component
      cumulativeComponentDependency - the value for the cumulativeComponentDependency record component
      averageComponentDependency - the value for the averageComponentDependency record component
      relativeAverageComponentDependency - the value for the relativeAverageComponentDependency record component
      normalizedCumulativeComponentDependency - the value for the normalizedCumulativeComponentDependency record component
      dependsOn - the value for the dependsOn record component
  • Method Details

    • samples

      public List<MetricSample> samples(ProjectionDomain domain)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • componentCount

      public int componentCount()
      Returns the value of the componentCount record component.
      Returns:
      the value of the componentCount record component
    • cumulativeComponentDependency

      public long cumulativeComponentDependency()
      Returns the value of the cumulativeComponentDependency record component.
      Returns:
      the value of the cumulativeComponentDependency record component
    • averageComponentDependency

      public double averageComponentDependency()
      Returns the value of the averageComponentDependency record component.
      Returns:
      the value of the averageComponentDependency record component
    • relativeAverageComponentDependency

      public double relativeAverageComponentDependency()
      Returns the value of the relativeAverageComponentDependency record component.
      Returns:
      the value of the relativeAverageComponentDependency record component
    • normalizedCumulativeComponentDependency

      public double normalizedCumulativeComponentDependency()
      Returns the value of the normalizedCumulativeComponentDependency record component.
      Returns:
      the value of the normalizedCumulativeComponentDependency record component
    • dependsOn

      public Map<StableId,Integer> dependsOn()
      Returns the value of the dependsOn record component.
      Returns:
      the value of the dependsOn record component