Package com.tngtech.archunit.core.domain
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDependency.Functionsstatic classDependency.Predicates
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Dependency o)booleanequals(java.lang.Object obj)java.lang.StringgetDescription()JavaClassgetOriginClass()SourceCodeLocationgetSourceCodeLocation()JavaClassgetTargetClass()inthashCode()java.lang.StringtoString()static JavaClassestoTargetClasses(java.lang.Iterable<Dependency> dependencies)
-
-
-
Method Detail
-
getOriginClass
@PublicAPI(usage=ACCESS) public JavaClass getOriginClass()
-
getTargetClass
@PublicAPI(usage=ACCESS) public JavaClass getTargetClass()
-
getDescription
@PublicAPI(usage=ACCESS) public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceHasDescription
-
getSourceCodeLocation
@PublicAPI(usage=ACCESS) public SourceCodeLocation getSourceCodeLocation()
- Specified by:
getSourceCodeLocationin interfaceHasSourceCodeLocation- Returns:
- The
SourceCodeLocationof this object, i.e. how to locate the respective object within the set of source files.
-
compareTo
@PublicAPI(usage=ACCESS) public int compareTo(Dependency o)
- Specified by:
compareToin interfacejava.lang.Comparable<Dependency>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toTargetClasses
@PublicAPI(usage=ACCESS) public static JavaClasses toTargetClasses(java.lang.Iterable<Dependency> dependencies)
-
-