Class Dependency

java.lang.Object
com.tngtech.archunit.core.domain.Dependency
All Implemented Interfaces:
HasDescription, HasSourceCodeLocation, java.lang.Comparable<Dependency>

public class Dependency
extends java.lang.Object
implements HasDescription, java.lang.Comparable<Dependency>, HasSourceCodeLocation
Represents a dependency of one Java class on another Java class. Such a dependency can occur by either of the following:
  • a class accesses a field of another class
  • a class calls a method of another class
  • a class calls a constructor of another class
  • a class inherits from another class (which is in fact a special case of constructor call)
  • a class implements an interface
  • a class has a field with type of another class
  • a class has a method/constructor with parameter/return type of another class
Note that a Dependency will by definition never be a self-reference, i.e. origin will never be equal to target.