Class CycleArchCondition<COMPONENT>
java.lang.Object
com.tngtech.archunit.lang.ArchCondition<COMPONENT>
com.tngtech.archunit.library.cycle_detection.rules.CycleArchCondition<COMPONENT>
- Type Parameters:
COMPONENT- The type of the component to check dependencies between
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public final class CycleArchCondition<COMPONENT>
extends ArchCondition<COMPONENT>
A generic
Construct it by following the fluent interface of
ArchCondition to check arbitrary COMPONENTs consisting of JavaClasses
for cyclic dependencies between those components (induced by the dependencies of the contained classes).Construct it by following the fluent interface of
builder().-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interfacestatic interfacestatic interfaceNested classes/interfaces inherited from class com.tngtech.archunit.lang.ArchCondition
ArchCondition.ConditionByPredicate<T extends HasDescription & HasSourceCodeLocation> -
Method Summary
Modifier and TypeMethodDescriptionstatic <COMPONENT>
CycleArchCondition.NeedsRetrieveClasses<COMPONENT>builder()voidcheck(COMPONENT component, ConditionEvents events) voidfinish(ConditionEvents events) Can be used/overridden to finish the evaluation of this condition.
ArchUnit will call this method once after every single item was checked (byArchCondition.check(Object, ConditionEvents)).
This method can be used, if violations are dependent on multiple/allArchCondition.check(Object, ConditionEvents)calls, on the contrary to the default case, where each singleArchCondition.check(Object, ConditionEvents)stands for itself.voidinit(Collection<COMPONENT> allComponents) Can be used/overridden to prepare this condition with respect to the collection of all objects the condition will be tested against.
ArchUnit will call this method once in the beginning, before starting to check single items.Methods inherited from class com.tngtech.archunit.lang.ArchCondition
and, as, forSubtype, from, getDescription, or, toString
-
Method Details
-
init
Description copied from class:ArchConditionCan be used/overridden to prepare this condition with respect to the collection of all objects the condition will be tested against.
ArchUnit will call this method once in the beginning, before starting to check single items.- Overrides:
initin classArchCondition<COMPONENT>- Parameters:
allComponents- All objects thatArchCondition.check(Object, ConditionEvents)will be called against
-
check
- Specified by:
checkin classArchCondition<COMPONENT>
-
finish
Description copied from class:ArchConditionCan be used/overridden to finish the evaluation of this condition.
ArchUnit will call this method once after every single item was checked (byArchCondition.check(Object, ConditionEvents)).
This method can be used, if violations are dependent on multiple/allArchCondition.check(Object, ConditionEvents)calls, on the contrary to the default case, where each singleArchCondition.check(Object, ConditionEvents)stands for itself.- Overrides:
finishin classArchCondition<COMPONENT>
-
builder
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public static <COMPONENT> CycleArchCondition.NeedsRetrieveClasses<COMPONENT> builder()
-