Class ArchitectureMetrics
java.lang.Object
com.tngtech.archunit.library.metrics.ArchitectureMetrics
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentDependencyMetricscomponentDependencyMetrics(MetricsComponents<JavaClass> components) Calculates system component dependency metrics as defined by Robert C.static LakosMetricslakosMetrics(MetricsComponents<JavaClass> components) Calculates system architecture metrics as defined by John Lakos.static <T> LakosMetricslakosMetrics(MetricsComponents<T> components, Function<T, Collection<T>> getDependencies) Calculates system architecture metrics as defined by John Lakos.static VisibilityMetricsvisibilityMetrics(MetricsComponents<JavaClass> components) Calculates system component visibility metrics as defined by Herbert Dowalil.static <T> VisibilityMetricsvisibilityMetrics(MetricsComponents<T> components, Predicate<? super T> isVisible) Calculates system component visibility metrics as defined by Herbert Dowalil.
-
Method Details
-
lakosMetrics
@PublicAPI(usage=ACCESS) public static LakosMetrics lakosMetrics(MetricsComponents<JavaClass> components) Calculates system architecture metrics as defined by John Lakos. This method is a specific version oflakosMetrics(MetricsComponents, Function)forJavaClasses.- Parameters:
components- The components to calculate the metrics for- Returns:
- The calculated
LakosMetrics
-
lakosMetrics
@PublicAPI(usage=ACCESS) public static <T> LakosMetrics lakosMetrics(MetricsComponents<T> components, Function<T, Collection<T>> getDependencies) Calculates system architecture metrics as defined by John Lakos.- Type Parameters:
T- The type of the elements- Parameters:
components- The components to calculate the metrics forgetDependencies- A function to derive for each element of a component the dependencies to all other elements- Returns:
- The calculated
LakosMetrics
-
componentDependencyMetrics
@PublicAPI(usage=ACCESS) public static ComponentDependencyMetrics componentDependencyMetrics(MetricsComponents<JavaClass> components) Calculates system component dependency metrics as defined by Robert C. Martin.- Parameters:
components- The components to calculate the metrics for- Returns:
- The calculated
ComponentDependencyMetrics
-
visibilityMetrics
@PublicAPI(usage=ACCESS) public static VisibilityMetrics visibilityMetrics(MetricsComponents<JavaClass> components) Calculates system component visibility metrics as defined by Herbert Dowalil. This method is a specific version ofvisibilityMetrics(MetricsComponents, Predicate)where the elements can only be of typeJavaClassand a class is considered visible, if and only if it is public.- Parameters:
components- The components to calculate the metrics for- Returns:
- The calculated
VisibilityMetrics
-
visibilityMetrics
@PublicAPI(usage=ACCESS) public static <T> VisibilityMetrics visibilityMetrics(MetricsComponents<T> components, Predicate<? super T> isVisible) Calculates system component visibility metrics as defined by Herbert Dowalil.- Parameters:
components- The components to calculate the metrics for- Returns:
- The calculated
VisibilityMetrics
-