Class ModuleRuleDefinition.RootClassesDefinition<DESCRIPTOR extends ArchModule.Descriptor>
java.lang.Object
com.tngtech.archunit.library.modules.syntax.ModuleRuleDefinition.RootClassesDefinition<DESCRIPTOR>
- All Implemented Interfaces:
GivenObjects<ArchModule<DESCRIPTOR>>,GivenModules<DESCRIPTOR>
- Enclosing class:
- ModuleRuleDefinition
@PublicAPI(usage=ACCESS,
state=EXPERIMENTAL)
public static final class ModuleRuleDefinition.RootClassesDefinition<DESCRIPTOR extends ArchModule.Descriptor>
extends Object
implements GivenModules<DESCRIPTOR>
-
Method Summary
Modifier and TypeMethodDescriptionAllows to adjust the description of the "given modules" part.<D extends ArchModule.Descriptor>
GivenModules<D>derivingModuleFromRootClassBy(DescribedFunction<? super JavaClass, D> descriptorFunction) should()Allows to specify assertions for the set ofArchModules under consideration.should(ArchCondition<? super ArchModule<DESCRIPTOR>> condition) Allows to form a rule by passing a condition the objects under consideration must satisfy.that(DescribedPredicate<? super ArchModule<DESCRIPTOR>> predicate) Allows to restrict the set of objects under consideration.
-
Method Details
-
derivingModuleFromRootClassBy
@PublicAPI(usage=ACCESS, state=EXPERIMENTAL) public <D extends ArchModule.Descriptor> GivenModules<D> derivingModuleFromRootClassBy(DescribedFunction<? super JavaClass, D> descriptorFunction) -
should
Description copied from interface:GivenObjectsAllows to form a rule by passing a condition the objects under consideration must satisfy. E.g.
all(customObjects).should(behaveAsExpected())- Specified by:
shouldin interfaceGivenObjects<DESCRIPTOR extends ArchModule.Descriptor>- Returns:
- An
ArchRulewhich can be evaluated on importedJavaClasses
-
that
public GivenModulesConjunction<DESCRIPTOR> that(DescribedPredicate<? super ArchModule<DESCRIPTOR>> predicate) Description copied from interface:GivenObjectsAllows to restrict the set of objects under consideration. E.g.
Note that many predefinedall(customObjects).that(predicate)predicatescan be found within a subclassPredicatesof the respective domain object or a common ancestor. For example,predicatestargetingJavaClasscan be found withinJavaClass.Predicatesor one of the respective ancestors likeHasName.Predicates.- Specified by:
thatin interfaceGivenModules<DESCRIPTOR extends ArchModule.Descriptor>- Specified by:
thatin interfaceGivenObjects<DESCRIPTOR extends ArchModule.Descriptor>- Returns:
- A syntax conjunction element, which can be completed to form a full rule
-
should
Description copied from interface:GivenModulesAllows to specify assertions for the set ofArchModules under consideration. E.g.
modules().should().respectTheirAllowedDependencies(..)
UseGivenObjects.should(ArchCondition)to freely customize the condition against which theArchModules should be checked.- Specified by:
shouldin interfaceGivenModules<DESCRIPTOR extends ArchModule.Descriptor>- Returns:
- A syntax element, which can be used to create rules for the
ArchModules under consideration
-
as
Description copied from interface:GivenModulesAllows to adjust the description of the "given modules" part. E.g.
would yield a rule text "App Modules should...".modules().definedByAnnotation(AppModule.class).as("App Modules").should()...- Specified by:
asin interfaceGivenModules<DESCRIPTOR extends ArchModule.Descriptor>
-